/* The study tool pages (src/site/tools/), on top of daylight.css and home.css. */

.tp-hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 5vw, 56px); align-items: center; padding-top: clamp(24px, 4vw, 48px); }
@media (max-width: 900px) { .tp-hero { grid-template-columns: minmax(0, 1fr); } }
.tp-hero-text { display: flex; flex-direction: column; gap: 18px; min-width: 0; }
.tp-hero h1 { font-size: clamp(40px, 5.2vw, 62px); line-height: 1.04; text-wrap: balance; }
.tp-actions { display: flex; flex-wrap: wrap; gap: 12px 14px; }
@media (max-width: 520px) { .tp-actions .btn { width: 100%; justify-content: center; } }

.tp-example { margin: 0; border-radius: var(--r-tile); padding: clamp(18px, 3vw, 28px); display: flex; flex-direction: column; gap: 14px; min-width: 0; }

.tp-steps { list-style: none; margin: 0; padding: 0; }
.tp-n { display: inline-grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--accent-700); color: #fff; font-weight: 800; }
.tp-faq { gap: 12px; max-width: 820px; }

.tp-more { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
main > .h-sec:last-child { padding-bottom: clamp(64px, 8vw, 96px); }


/* Flashcards: each card shows its front; tools.js turns it. Without the script both faces show. */
.tp-cards { display: grid; gap: 12px; }
.tp-card { font: inherit; text-align: left; width: 100%; display: grid; border-radius: var(--r-md); padding: 18px 20px; min-height: 108px; cursor: pointer; color: var(--ink); }
.tp-card:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.tp-face { display: flex; flex-direction: column; gap: 6px; font-size: 17px; font-weight: 700; line-height: 1.35; }
.tp-back { font-weight: 500; font-size: 16px; color: var(--ink-body); }
.tp-k { font-size: 11.5px; font-weight: 800; letter-spacing: .09em; text-transform: uppercase; color: var(--accent-700); }
.js-on .tp-face { grid-area: 1 / 1; transition: opacity .18s ease; }
.js-on .tp-back { opacity: 0; visibility: hidden; }
.js-on .tp-card[aria-pressed="true"] .tp-front { opacity: 0; visibility: hidden; }
.js-on .tp-card[aria-pressed="true"] .tp-back { opacity: 1; visibility: visible; }
.js-on .tp-card[aria-pressed="true"] { --fill: var(--card); }
.tp-hint { display: none; }
.js-on .tp-hint { display: block; }
@media (prefers-reduced-motion: reduce) { .js-on .tp-face { transition: none; } }

/* Wide examples (the 3D model) go under the headline. */
.tp-hero-wide { grid-template-columns: minmax(0, 1fr); }
.tp-hero-wide .tp-hero-text { max-width: 760px; }
.tp-example .m3d { margin: 0; }

/* Mind map */
.tp-map { display: flex; flex-direction: column; gap: 14px; }
.tp-map-root { align-self: center; background: var(--sage-700); color: #fff; font-weight: 800; font-size: 17px; border-radius: 999px; padding: 8px 20px; }
.tp-map-branches { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 420px) { .tp-map-branches { grid-template-columns: minmax(0, 1fr); } }
.tp-branch { --b: var(--accent-700); --bg: var(--accent-100); border: 1.5px solid var(--b); border-radius: 16px; background: var(--bg); padding: 10px 14px; }
.tp-b-sage { --b: var(--sage-700); --bg: #e7f3f1; }
.tp-b-amber { --b: var(--amber); --bg: #fbf2df; }
.tp-b-violet { --b: var(--violet); --bg: #f6ecfa; }
.tp-branch summary { cursor: pointer; font-weight: 800; color: var(--ink); display: flex; align-items: center; gap: 8px; min-height: 32px; }
.tp-bn { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--b); color: #fff; font-size: 13px; flex: none; }
.tp-branch ul { margin: 8px 0 2px; padding-left: 20px; font-size: 15px; display: grid; gap: 4px; }
.tp-branch li::marker { color: var(--b); }

/* Practice questions: tools.js turns the options on; without it the answer is under "Show the answer". */
.tp-qs { list-style: none; margin: 0; padding: 0; display: grid; gap: 18px; }
.tp-q { display: grid; gap: 10px; }
.tp-stem { font-weight: 700; color: var(--ink); font-size: 16.5px; line-height: 1.4; }
.tp-opts { display: grid; gap: 8px; }
.tp-opt { font: inherit; text-align: left; display: flex; gap: 10px; align-items: center; min-height: 44px; padding: 8px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); color: var(--ink-body); }
.tp-opt b { color: var(--ink-soft); }
.tp-opt:not([disabled]) { cursor: pointer; }
.tp-opt:not([disabled]):hover { border-color: var(--accent); }
.tp-opt:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.tp-opt.right { border-color: var(--sage-700); background: var(--sage-200); color: var(--ink); font-weight: 700; }
.tp-opt.wrong { border-color: #a2483a; background: #f7e1dc; color: var(--ink); }
.tp-result { font-weight: 700; min-height: 0; }
.tp-result:empty { display: none; }
.tp-result.ok { color: var(--sage-700); }
.tp-result.no { color: #a2483a; }
.tp-why summary { cursor: pointer; font-weight: 700; color: var(--accent-700); }
.tp-why p { margin-top: 6px; font-size: 15px; }

/* Graph and visual */
.tp-graph, .tp-cycle { width: 100%; height: auto; display: block; }
.tp-g-grid line { stroke: var(--line-soft); stroke-width: 1; }
.tp-g-axis { stroke: var(--ink-soft); stroke-width: 1.5; }
.tp-g-ticks text { font: 600 12px var(--sans); fill: var(--ink-muted); }
.tp-g-curve { fill: none; stroke: var(--accent); stroke-width: 3; stroke-linejoin: round; }
.tp-g-dot { fill: var(--accent-700); stroke: #fff; stroke-width: 2; }
.tp-g-label { font: 700 13px var(--sans); fill: var(--ink); paint-order: stroke; stroke: var(--card); stroke-width: 4px; }
.tp-c-arcs path { fill: none; stroke: var(--ink-soft); stroke-width: 2; }
.tp-cycle marker path { fill: var(--ink-soft); }
.tp-c-boxes text { font: 700 13.5px var(--sans); fill: var(--ink); }
.tp-c-mid { font: 400 18px var(--display); fill: var(--ink); }
