/* Teaching ideas pages (/ideas/): the Instructional Choiceboard and Dynamic Lesson Design.
   Loaded after site.css and uses its tokens (suit colours, navy band, fonts). No inline styles (CSP).
   Cards follow the deck's look: a solid suit-colour top with a white cut line, then a light body.
   Print rules at the bottom turn each page into one sheet; the PDFs are made from them. */

/* Page head: the dark navy band, like the hero, with the suit tabs along its bottom edge. */
.ideas-head { position: relative; background: var(--navy); color: var(--on-navy); padding-block: clamp(2rem, 6vw, 3.75rem) clamp(2.5rem, 6vw, 4rem); --focus: var(--yellow); }
.ideas-head .tabs { position: absolute; left: 0; right: 0; bottom: 0; }
.ideas-head .wrap p.eyebrow { color: rgba(255, 255, 255, .78); }
.ideas-head h1 { font-size: clamp(1.9rem, 5.4vw, 3.4rem); text-transform: uppercase; line-height: 1.07; margin-bottom: .9rem; text-wrap: balance; overflow-wrap: anywhere; }
.ideas-lede { font-size: clamp(1.0625rem, 2vw, 1.25rem); color: rgba(255, 255, 255, .92); max-width: 44rem; margin-bottom: 1rem; }
.ideas-by { font-family: var(--display); font-size: 1.05rem; color: #fff; margin-bottom: 1.25rem; }
.ideas-actions { display: flex; flex-wrap: wrap; gap: .6rem; }
.ideas-share { margin: .9rem 0 0; color: rgba(255, 255, 255, .9); font-size: 1rem; }
.ideas-status { margin: .9rem 0 0; min-height: 1.5rem; font-weight: 600; color: #fff; }
.ideas-status:empty { min-height: 0; margin: 0; }

/* Links under each card: "Watch" and "Read" chips. */
.idea-links { display: grid; gap: .15rem; margin-top: auto; padding-top: .5rem; }
.idea-links a { display: flex; align-items: baseline; gap: .45rem; min-height: 44px; padding-block: .55rem; color: var(--ink); text-decoration: none; border-top: 1px solid var(--rule); line-height: 1.3; }
.idea-links a:hover { color: var(--primary); }
.idea-links a:hover .kind { background: var(--suit); }
.idea-links .kind { flex: none; font: 600 .75rem/1 var(--body); letter-spacing: .08em; text-transform: uppercase; padding: .3rem .45rem; border-radius: .35rem; background: var(--soft); color: var(--ink); }

/* ------------------------------------------------------------ Choiceboard */
.cb-grid { display: grid; gap: 1rem; align-items: start; grid-template-columns: repeat(auto-fill, minmax(min(100%, 15.5rem), 1fr)); counter-reset: cb; }
.cb-card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--rule); border-radius: 1rem; box-shadow: var(--shadow); overflow: hidden; scroll-margin-top: 5rem; transition: box-shadow .25s var(--ease), transform .25s var(--ease); }
.cb-card > p { margin: .65rem .9rem .35rem; font-size: 1rem; line-height: 1.45; }
.cb-card .idea-links { padding-bottom: .4rem; }
.ql-grid { align-items: stretch; }
.cb-card > p.ql-tip { margin-bottom: .9rem; color: var(--muted); }
.ql-tm { margin-top: 1.25rem; font-size: 1rem; color: var(--muted); }
.ql-placeholder { display: block; padding: .6rem .8rem; border: 2px dashed var(--rule); border-radius: .6rem; font-style: italic; }
/* Links sit behind a "Watch and read" row so the board stays compact. Print opens them. */
.cb-more { margin: auto .9rem 0; border-top: 1px solid var(--rule); }
.cb-more summary { display: flex; align-items: center; justify-content: space-between; gap: .5rem; min-height: 44px; cursor: pointer; list-style: none; font-weight: 600; font-size: 1rem; color: var(--primary); }
.cb-more summary::-webkit-details-marker { display: none; }
.cb-more summary::after { content: ""; flex: none; width: .55rem; height: .55rem; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -.15rem; transition: rotate .2s var(--ease); }
.cb-more[open] summary::after { rotate: 225deg; translate: 0 .1rem; }
.cb-count { font-weight: 400; color: var(--muted); margin-right: auto; }
.cb-more .idea-links { margin-top: 0; padding-top: 0; }
@media (prefers-reduced-motion: reduce) { .cb-more summary::after { transition: none; } }
.cb-name { counter-increment: cb; display: flex; align-items: center; gap: .6rem; margin: .35rem .35rem 0; padding: .8rem .8rem; background: var(--suit); color: var(--ink-on-suit); border-radius: .75rem; box-shadow: inset 0 0 0 3px var(--suit), inset 0 0 0 5px var(--cut); font-size: 1.2rem; outline-offset: 4px; }
.cb-name::before { content: counter(cb); flex: none; display: grid; place-items: center; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: rgba(255, 255, 255, .55); font: 700 .95rem/1 var(--body); }
.cb-picked-tag { align-self: flex-start; margin: .6rem .9rem 0; padding: .25rem .6rem; border-radius: 999px; background: var(--navy); color: #fff; font: 600 .875rem/1.2 var(--body); }
.cb-card.is-picked { box-shadow: 0 0 0 4px var(--suit), var(--shadow-lift); transform: translateY(-3px); }
@media (prefers-reduced-motion: reduce) { .cb-picked-tag { align-self: flex-start; margin: .6rem .9rem 0; padding: .25rem .6rem; border-radius: 999px; background: var(--navy); color: #fff; font: 600 .875rem/1.2 var(--body); }
.cb-card.is-picked { transform: none; } }

/* ------------------------------------------------------------ Dynamic Lesson Design */
.dld-part + .dld-part { margin-top: 2.25rem; }
.dld-label { display: flex; align-items: center; gap: .7rem; font-size: clamp(1.4rem, 3.2vw, 2rem); margin-bottom: 1rem; text-transform: uppercase; }
.dld-label span { display: grid; place-items: center; width: 2.4rem; height: 2.4rem; border-radius: .6rem; background: var(--navy); color: #fff; font-size: 1.2rem; rotate: -6deg; }
/* On screen the seven steps are one even, numbered list: same width, same layout, step after step.
   Wide screens put the step name, its questions and its links side by side. Print turns it back into the planning sheet grid. */
.post-resource { counter-reset: dld; }
.dld-grid { display: grid; gap: .75rem; }
.dld-card { counter-increment: dld; position: relative; display: grid; gap: .35rem 1.5rem; grid-template-columns: 1fr; background: var(--surface); border: 1px solid var(--rule); border-left: .55rem solid var(--suit); border-radius: 1rem; box-shadow: var(--shadow); padding: 1rem 1.1rem .6rem; }
.dld-card h4 { display: flex; align-items: center; gap: .6rem; font-size: 1.3rem; margin: 0; }
.dld-card h4::before { content: counter(dld); flex: none; display: grid; place-items: center; width: 2rem; height: 2rem; border-radius: 50%; background: var(--suit); color: var(--ink-on-suit); font: 700 1rem/1 var(--body); }
.dld-card .idea-links { margin-top: .25rem; padding-top: 0; }
.dld-note { margin: .2rem 0 .4rem; color: var(--muted); font-size: 1rem; line-height: 1.5; }
.post-resource + .post { padding-top: 0; }
@media (min-width: 52rem) {
  .dld-card { grid-template-columns: 13rem 1fr; align-items: start; padding: 1.1rem 1.25rem; }
  .dld-card .dld-q { margin: .25rem 0 .4rem; }
}
.dld-q { display: grid; gap: .4rem; margin-bottom: .4rem; }
.dld-q li { position: relative; padding-left: 1.1rem; }
.dld-q li::before { content: ""; position: absolute; left: 0; top: .5em; width: .5rem; height: .5rem; border-radius: 2px; background: var(--suit); rotate: -12deg; }
.dld-notes { display: none; }

.ideas-print-brand { display: none; }

/* Notes under the grids */
.ideas-note { max-width: 44rem; margin-top: 2.5rem; }
.ideas-note h2 { font-size: 1.4rem; margin-bottom: .6rem; }
.ideas-credit { color: var(--muted); font-size: 1rem; }

/* ------------------------------------------------------------ Post: the article above each resource */
.post { padding-block: clamp(2rem, 5vw, 3rem) 0; }
.post-body { max-width: 44rem; }
.post-body h2 { font-size: clamp(1.3rem, 2.6vw, 1.6rem); margin: 2rem 0 .6rem; }
.post-body p { font-size: 1.0625rem; line-height: 1.65; margin-bottom: 1rem; }
.post-body a { color: var(--primary); }
.post-date { white-space: nowrap; font-family: var(--body); font-weight: 400; color: rgba(255, 255, 255, .85); }
.post-resource { padding-top: clamp(2rem, 5vw, 3rem); }
.post-resource-title { font-size: clamp(1.5rem, 3.4vw, 2.1rem); text-transform: uppercase; margin-bottom: 1rem; padding-top: 1.25rem; border-top: 3px solid; border-image: linear-gradient(90deg, var(--blue) 0 25%, var(--green) 0 50%, var(--yellow) 0 75%, var(--red) 0) 1; scroll-margin-top: 5rem; outline-offset: 4px; }

/* ------------------------------------------------------------ Hub
   A compact list: small thumbnail, date, title (the link covers the whole row), two lines of blurb, topics.
   Above it the search box, sort and topic chips (public/assets/js/ideas.js). Without JavaScript the tools stay
   hidden and every post shows. */
.hub { padding-top: clamp(1.75rem, 4vw, 2.75rem); container-type: inline-size; }
.hub-tools { display: none; }
.hub-tools[hidden], .hub-chips[hidden], .hub-nomatch[hidden] { display: none !important; }
.js .hub-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: .9rem; margin-bottom: 1.25rem; padding: 1rem; background: var(--surface); border: 1px solid var(--rule); border-radius: 1rem; box-shadow: var(--shadow); }
.hub-find { display: grid; gap: .75rem; grid-template-columns: minmax(0, 1fr) auto; align-items: end; }
.hub-field { display: grid; gap: .3rem; }
.hub-field label { font-weight: 600; font-size: 1rem; }
.hub-field input, .hub-field select { width: 100%; min-height: 2.875rem; padding: .5rem .9rem; font: 1rem var(--body); color: var(--ink); background: var(--bg); border: 2px solid var(--muted); border-radius: .7rem; }
.hub-field input { padding-left: 2.6rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566673' stroke-width='2.4' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='M15.5 15.5 21 21'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 1.2rem; background-position: .8rem 50%; }
.hub-field input::placeholder { color: var(--muted); opacity: 1; }
.hub-field input:focus-visible, .hub-field select:focus-visible { border-color: var(--primary); }
.hub-field select { padding-right: 2.25rem; appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23566673' stroke-width='2.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-size: 1rem; background-position: right .75rem center; cursor: pointer; }
.hub-chips { position: relative; display: flex; flex-wrap: wrap; gap: .4rem; }
.hub-chip { position: relative; flex: none; white-space: nowrap; display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; padding: .35rem .85rem; font: 500 1rem/1.2 var(--body); color: var(--ink); background: var(--bg); border: 2px solid var(--rule); border-radius: 999px; cursor: pointer; transition: background-color .15s, border-color .15s; }
.hub-chip:hover { border-color: var(--primary); }
.hub-chip .n { font-size: .875rem; font-weight: 600; color: var(--muted); }
.hub-chip[aria-pressed="true"] { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.hub-chip[aria-pressed="true"] .n { color: inherit; }
.hub-count { margin: 0; font-weight: 600; color: var(--muted); font-size: 1rem; }
.hub-count:empty { display: none; }

.hub-list { display: grid; gap: .75rem; }
.hub-item { position: relative; display: grid; grid-template-columns: 6.5rem minmax(0, 1fr); gap: .9rem; align-items: start; padding: .7rem .9rem .5rem .7rem; background: var(--surface); border: 1px solid var(--rule); border-left: .4rem solid var(--suit); border-radius: .9rem; box-shadow: var(--shadow); transition: box-shadow .25s var(--ease); }
.hub-item:hover { box-shadow: var(--shadow-lift); }
.hub-item:has(.hub-link:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.hub-item[hidden] { display: none; }
.hub-thumb { width: 100%; height: auto; aspect-ratio: 3 / 2; object-fit: cover; border-radius: .5rem; background: var(--soft); margin-top: .2rem; }
.hub-body { min-width: 0; }
.hub-date { margin: 0; font-size: 1rem; font-weight: 600; color: var(--muted); line-height: 1.3; }
.hub-title { font-size: 1.2rem; line-height: 1.25; margin: .1rem 0 .2rem; }
.hub-link { color: var(--ink); text-decoration: none; }
.hub-link::after { content: ""; position: absolute; inset: 0; border-radius: inherit; }
.hub-link:focus-visible { outline: none; }
.hub-item:hover .hub-link { color: var(--primary); text-decoration: underline; }
.hub-blurb { margin: 0; color: var(--muted); font-size: 1rem; line-height: 1.45; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.hub-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .1rem 1rem; margin-top: .2rem; }
.hub-tags { display: flex; flex-wrap: wrap; gap: .3rem; padding: .35rem 0; }
.hub-tags li { font-size: 1rem; line-height: 1.2; padding: .15rem .55rem; border-radius: 999px; background: var(--soft); color: var(--sink); font-weight: 500; }
.hub-pdf { position: relative; z-index: 1; display: inline-flex; align-items: center; min-height: 44px; font-weight: 600; color: var(--primary); }
.hub-nomatch { display: grid; justify-items: start; gap: .5rem; padding: 1.25rem; border: 2px dashed var(--rule); border-radius: 1rem; }
.hub-nomatch[hidden] { display: none; }
.hub-nomatch p { margin: 0; }
.hub-empty { font-size: 1.0625rem; }
@container (min-width: 60rem) { .hub-list { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@container (max-width: 30rem) {
  .hub-find { grid-template-columns: minmax(0, 1fr); }
  .hub-item { grid-template-columns: 4.5rem minmax(0, 1fr); gap: .7rem; }
  .hub-title { font-size: 1.1rem; }
  .js .hub-tools { padding: .8rem; }
  /* Phones: the topics sit on one row that scrolls sideways inside the box, so the posts start sooner. */
  .hub-chips { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity; margin-inline: -.8rem; padding: .25rem 3rem .5rem .8rem; scrollbar-width: thin; -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
  .hub-chip { scroll-snap-align: start; }
}

/* Topics under a post's byline, on the navy band. Each one opens the hub filtered to that topic. */
.ideas-tags { display: flex; flex-wrap: wrap; gap: .4rem; margin: -.6rem 0 1.25rem; }
.ideas-tags a { display: inline-flex; align-items: center; min-height: 44px; padding: .3rem .9rem; border: 2px solid rgba(255, 255, 255, .55); border-radius: 999px; color: #fff; font-weight: 500; font-size: 1rem; text-decoration: none; }
.ideas-tags a:hover { background: rgba(255, 255, 255, .12); border-color: #fff; color: #fff; }

/* ------------------------------------------------------------ Print: one sheet per page.
   Choiceboard: a 4 by 4 board on letter portrait. Lesson design: a planning sheet on letter landscape with space to write. */
@media print {
  body { background: #fff; }
  .ideas { color: #14212e; }
  .ideas-head { background: none; color: #14212e; padding: 0 0 .15in; }
  .ideas-head .tabs, .ideas-actions, .ideas-share, .ideas-status, .ideas-note, .post, .post-resource-title, .post-date, .footer, .skip { display: none !important; }
  .ideas .post-resource { padding: 0; }
  .ideas-head .wrap p.eyebrow { display: none; }
  .ideas-head h1 { color: #1d3a4f; font-size: 21pt; margin: 0 0 3pt; }
  .ideas-lede { color: #14212e; font-size: 8.8pt; line-height: 1.35; margin: 0 0 2pt; max-width: none; }
  .ideas-by { color: #305f82; font-size: 9pt; margin: 0; }
  .ideas .section { padding: 0; }
  .ideas-print-brand { display: flex; align-items: center; justify-content: space-between; gap: 12pt; margin-bottom: 6pt; padding-bottom: 5pt; border-bottom: 3pt solid; border-image: linear-gradient(90deg, #6ca9d8 0 25%, #80c783 0 50%, #ffd54f 0 75%, #e57373 0) 1; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .ideas-print-brand img { width: 1.35in; height: auto; }
  .ideas-print-brand span { font-size: 8.5pt; color: #305f82; }
  .ideas .wrap { max-width: none; padding: 0; }
  .cb-card, .dld-card { display: flex; flex-direction: column; }
  .ideas-tags, .hub-tools { display: none !important; }
  .hub-item { box-shadow: none; break-inside: avoid; }
  .idea-links a { min-height: 0; color: #14212e; }
}
@media print {
  .cb-grid { grid-template-columns: repeat(4, 1fr); gap: 5pt; align-items: stretch; }
  .cb-card { border-radius: 8pt; border-color: #c9d3cc; }
  .cb-name { font-size: 9.5pt; padding: 3.5pt 5pt; margin: 3pt 3pt 0; border-radius: 6pt; gap: 4pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .cb-name::before { width: 14pt; height: 14pt; font-size: 7.5pt; }
  .cb-card > p { font-size: 7pt; line-height: 1.28; margin: 3pt 5pt 1pt; }
  .cb-card .idea-links { margin: 0; padding: 0 0 2pt; gap: 0; }
  .cb-more { margin: 0 5pt; border-top: 0; }
  .cb-more summary { display: none; }
  .cb-more::details-content { content-visibility: visible; }
  .idea-links a { font-size: 6.3pt; padding: 1.4pt 0; gap: 3pt; line-height: 1.2; }
  .idea-links .kind { font-size: 5.4pt; padding: 1.5pt 2.5pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .dld-part + .dld-part { margin-top: 8pt; }
  .dld-label { font-size: 13pt; margin-bottom: 5pt; }
  .dld-label span { width: 17pt; height: 17pt; font-size: 9pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .dld-grid { gap: 7pt; align-items: stretch; }
  .dld-three { grid-template-columns: repeat(3, 1fr); }
  .dld-four { grid-template-columns: repeat(4, 1fr); }
  .dld-four .dld-notes { min-height: 1.6in; }
  .dld-card { display: flex; flex-direction: column; align-items: stretch; gap: 0; border-left-width: 1px; border-left-color: var(--rule); border-top: 4pt solid var(--suit); padding: 6pt 7pt 4pt; border-radius: 7pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .dld-card h4::before, .dld-note { display: none; }
  .dld-body { display: contents; }
  .dld-card .idea-links { margin-top: 0; }
.dld-card h4 { font-size: 11pt; margin-bottom: 3pt; }
  .dld-q { gap: 1pt; font-size: 8pt; line-height: 1.25; }
  .dld-q li::before { print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  .dld-card .idea-links { display: none; }
  .dld-notes { display: block; flex: 1; min-height: 1.05in; margin-top: 4pt; background-image: linear-gradient(to bottom, transparent 15pt, #b3bfb7 15pt); background-size: 100% 16pt; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
}

/* Figures in a post (diagrams, flow charts, Patrick's graphics): tools/ideas/figures/README.md */
.post-fig { margin: 1.75rem 0 2rem; }
.post-fig img { display: block; width: 100%; height: auto; border-radius: var(--r); border: 1px solid var(--rule); background: #fff; box-shadow: var(--shadow); }
.post-fig figcaption { margin-top: .6rem; font-size: .95rem; line-height: 1.5; color: var(--muted); }

/* Preview banner: Patrick, signed in, looking at a post that is not released yet (src/releases.js) */
.release-preview { margin: 0; padding: .85rem var(--gut); background: var(--yellow); color: var(--ink-on-suit); font-weight: 600; text-align: center; }
.release-preview a { color: var(--ink-on-suit); text-decoration: underline; }
/* The hub's note when no post is released yet */
.hub-empty { font-size: 1.0625rem; color: var(--muted); padding: 1rem 0 2rem; }
.post-fig-zoom { display: block; }
