/* Guides (/guides, pages/guides.php) and their cards on the home and help pages. Colours come from the site tokens (ahh.css). */
.guide-shell{max-width:1120px;margin:0 auto;padding:32px 24px 72px;min-height:70vh}
.guide-crumbs{font-size:.875rem;color:var(--muted);display:flex;flex-wrap:wrap;gap:2px 6px}
.guide-crumbs a{color:var(--muted);text-decoration:none}.guide-crumbs a:hover{color:var(--accent-text)}
.guide-crumbs [aria-current]{color:var(--text-2,var(--text));overflow:hidden;text-overflow:ellipsis;white-space:nowrap;max-width:100%}
.guide-crumbs.is-article,.guide-draft{max-width:760px;margin-left:auto;margin-right:auto}
.guide-draft{margin-top:16px;margin-bottom:0;padding:10px 14px;border-radius:12px;background:var(--warn-soft);border:1px solid var(--warn-line);color:var(--text);font-size:.9rem;font-weight:600}

/* The list */
.guides-head{max-width:760px;margin:22px 0 34px}
.guides-head h1{font-size:clamp(1.9rem,1.2rem + 2.4vw,2.8rem);line-height:1.15;letter-spacing:-.035em;font-weight:800;margin:0 0 14px}
.guides-head p{font-size:1.06rem;line-height:1.75;color:var(--muted);margin:0}
.guides-group{margin:0 0 40px}
.guides-group h2,.guide-related h2{font-size:1.15rem;font-weight:700;letter-spacing:-.01em;margin:0 0 14px}
.guides-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(280px,1fr));gap:18px}
.guide-card{display:flex;flex-direction:column;gap:10px;padding:22px 22px 20px;border-radius:20px;background:var(--surface);border:1px solid var(--line);color:var(--text);text-decoration:none;box-shadow:var(--elev-1,0 1px 2px rgba(15,40,80,.05));transition:transform .2s,box-shadow .2s,border-color .2s;min-width:0}
.guide-card:hover{transform:translateY(-2px);border-color:var(--accent-line,var(--accent));box-shadow:var(--elev-2,0 10px 30px rgba(15,40,80,.08))}
.guide-card:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.guide-card-topic{font-size:.74rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-text)}
.guide-card-title{font-size:1.12rem;font-weight:750;line-height:1.3;letter-spacing:-.015em}
.guide-card-short{font-size:.93rem;line-height:1.6;color:var(--muted);display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden}
.guide-card-meta{margin-top:auto;font-size:.8rem;color:var(--faint,var(--muted))}

/* One guide */
.guide{max-width:760px;margin:0 auto}
.guide-head{margin:22px 0 22px}
.guide-topic{margin:0 0 10px;font-size:.78rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase}
.guide-topic a{color:var(--accent-text);text-decoration:none}
.guide-head h1{font-size:clamp(1.85rem,1.15rem + 2.3vw,2.7rem);line-height:1.18;letter-spacing:-.035em;font-weight:800;margin:0 0 14px;text-wrap:balance}
.guide-meta{margin:0;font-size:.9rem;color:var(--muted)}
.guide-short{margin:0 0 22px;padding:18px 22px;border-radius:18px;background:var(--accent-soft);border:1px solid var(--accent-line,transparent);border-left:4px solid var(--accent)}
.guide-short strong{display:block;font-size:.8rem;letter-spacing:.06em;text-transform:uppercase;color:var(--accent-text);margin-bottom:6px}
.guide-short p{margin:0;font-size:1.04rem;line-height:1.7;color:var(--text)}
.guide-toc{margin:0 0 26px;border:1px solid var(--line);border-radius:16px;padding:12px 18px;background:var(--surface)}
.guide-toc summary{cursor:pointer;font-weight:650}
.guide-toc ol{margin:10px 0 2px;padding-left:22px;display:grid;gap:6px}
.guide-toc a{color:var(--accent-text);text-decoration:none}.guide-toc a:hover{text-decoration:underline}
.guide-body{font-size:1.06rem;line-height:1.8;color:var(--text);overflow-wrap:break-word}
.guide-body h2{font-size:clamp(1.35rem,1.1rem + .8vw,1.6rem);line-height:1.3;letter-spacing:-.02em;font-weight:750;margin:40px 0 12px;scroll-margin-top:96px}
.guide-body h3{font-size:1.12rem;line-height:1.4;font-weight:700;margin:26px 0 8px}
.guide-body p{margin:0 0 16px}
.guide-body ul,.guide-body ol{margin:0 0 18px;padding-left:24px}
.guide-body li{margin:6px 0}.guide-body li ul{margin:6px 0 0}
.guide-body a{color:var(--accent-text);text-decoration:underline;text-underline-offset:3px}
.guide-body blockquote{margin:18px 0;padding:14px 20px;border-left:3px solid var(--accent);background:var(--surface-2);border-radius:0 14px 14px 0;font-size:1.02rem}
.guide-body blockquote p{margin:0}
.guide-body del{color:var(--danger);text-decoration-thickness:2px}
.guide-body strong{font-weight:700}
.guide-nowrap{white-space:nowrap}
.guide-body hr{border:0;border-top:1px solid var(--line);margin:30px 0}
.guide-table{margin:18px 0 24px;overflow-x:auto;border:1px solid var(--line);border-radius:16px;background:var(--surface);-webkit-overflow-scrolling:touch}
.guide-table table{border-collapse:collapse;width:100%;min-width:680px;font-size:.9rem;line-height:1.55}
.guide-table th,.guide-table td{padding:11px 14px;text-align:left;vertical-align:top;border-bottom:1px solid var(--line)}
.guide-table th{background:var(--surface-2);font-weight:700;white-space:nowrap}
.guide-table tr:last-child td{border-bottom:0}
.guide-table tr:last-child td{background:var(--accent-soft)}
.guide-cta{margin:24px 0}
.guide-cta .btn{display:inline-flex;align-items:center;gap:8px;min-height:50px;padding:0 26px;border-radius:999px;background:var(--btn-bg);color:var(--on-accent);font-weight:700;text-decoration:none;box-shadow:var(--btn-shadow);transition:transform .2s,box-shadow .2s}
.guide-cta .btn:hover{transform:translateY(-1px);box-shadow:var(--btn-shadow-hover)}
.guide-faq{margin:44px 0 0}
.guide-faq h2{font-size:clamp(1.35rem,1.1rem + .8vw,1.6rem);letter-spacing:-.02em;font-weight:750;margin:0 0 10px;scroll-margin-top:96px}
.guide-qa{border-bottom:1px solid var(--line);padding:16px 0}
.guide-qa summary{cursor:pointer;font-weight:650;font-size:1.05rem;list-style:none;display:flex;justify-content:space-between;gap:16px;align-items:center}
.guide-qa summary::-webkit-details-marker{display:none}
.guide-qa summary::after{content:"+";flex:none;width:28px;height:28px;border-radius:50%;border:1px solid var(--line);display:grid;place-items:center;color:var(--accent-text);font-weight:600}
.guide-qa[open] summary::after{content:"−";background:var(--accent);border-color:transparent;color:var(--on-accent)}
.guide-qa div{padding-top:10px;line-height:1.75}.guide-qa div p{margin:0 0 10px}
.guide-qa div a{color:var(--accent-text)}
.guide-author{display:flex;gap:14px;align-items:center;margin:40px 0 0;padding:20px 0 0;border-top:1px solid var(--line)}
.guide-avatar{flex:none;width:46px;height:46px;border-radius:50%;background:var(--accent);color:var(--on-accent);display:grid;place-items:center;font-weight:800;font-size:.8rem}
.guide-author p{margin:0;color:var(--muted);font-size:.92rem;line-height:1.6}
.guide-related{max-width:1120px;margin:56px auto 0}
.guide-all{max-width:760px;margin:28px auto 0}
.guide-all a{color:var(--accent-text);font-weight:600;text-decoration:none}

/* The level self-check inside a guide ("```level-test", assets/js/guides.js): one question at a time */
.guide-test{margin:28px 0 34px;padding:clamp(18px,3vw,28px);border:1px solid var(--line);border-radius:22px;background:var(--surface);overflow-x:clip;scroll-margin-top:96px}
.guide-test [hidden]{display:none!important}
.guide-test .gt-meta{display:flex;justify-content:space-between;align-items:center;gap:12px;margin:0;font-size:.88rem;color:var(--muted)}
.guide-test .gt-chip{display:inline-flex;align-items:center;padding:4px 11px;border-radius:999px;background:var(--accent-soft);color:var(--accent-text);font-size:.74rem;font-weight:700;letter-spacing:.07em;text-transform:uppercase}
.guide-test .gt-count{font-weight:600;font-variant-numeric:tabular-nums;white-space:nowrap}
.guide-test .gt-progress{height:6px;margin:12px 0 24px;border-radius:999px;background:var(--surface-2);overflow:hidden}
.guide-test .gt-progress span{display:block;height:100%;width:0;border-radius:inherit;background:var(--accent);transition:width .35s ease}
.guide-test .gt-q{margin:0 0 26px;padding:0;border:0;min-width:0}
.guide-test.is-stepper .gt-q{margin:0}
.guide-test legend{display:flex;gap:12px;align-items:flex-start;padding:0;margin:0 0 14px;font-weight:700;font-size:1.04rem;line-height:1.5;outline:none}
.guide-test.is-stepper legend{font-size:clamp(1.08rem,1rem + .4vw,1.24rem);line-height:1.45;letter-spacing:-.01em}
.guide-test .gt-n{flex:none;display:grid;place-items:center;width:30px;height:30px;border-radius:50%;background:var(--accent-soft);color:var(--accent-text);font-size:.86rem;font-weight:800}
.guide-test.is-stepper .gt-n{display:none}
.guide-test .gt-opts{display:grid;gap:8px}
.guide-test .gt-opt{display:flex;gap:12px;align-items:flex-start;padding:12px 14px;border:1px solid var(--line);border-radius:14px;background:var(--surface);cursor:pointer;font-size:.98rem;line-height:1.55;transition:border-color .15s,background-color .15s,transform .15s;-webkit-tap-highlight-color:transparent}
.guide-test .gt-opt:hover{border-color:var(--accent-line,var(--accent))}
.guide-test .gt-opt:active{transform:scale(.99)}
.guide-test .gt-opt input{flex:none;width:18px;height:18px;margin:3px 0 0;accent-color:var(--accent)}
.guide-test .gt-opt:has(input:focus-visible){box-shadow:var(--focus-ring)}
.guide-test .gt-opt.is-checked{border-color:var(--accent);background:var(--accent-soft)}
.guide-test .gt-nav{display:flex;align-items:center;gap:12px;margin-top:22px}
.guide-test .gt-back{display:inline-flex;align-items:center;gap:8px;min-height:48px;padding:0 18px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--text);font:inherit;font-weight:650;cursor:pointer}
.guide-test .gt-back:hover{border-color:var(--accent-line,var(--accent))}
.guide-test .gt-next{display:inline-flex;align-items:center;justify-content:center;gap:8px;min-height:48px;margin-left:auto;padding:0 24px;border:0;border-radius:999px;background:var(--btn-bg);color:var(--on-accent);font:inherit;font-weight:700;cursor:pointer;box-shadow:var(--btn-shadow);transition:transform .2s,box-shadow .2s,opacity .2s}
.guide-test .gt-next:hover:not([disabled]){transform:translateY(-1px);box-shadow:var(--btn-shadow-hover)}
.guide-test .gt-next[disabled]{opacity:.4;cursor:default;box-shadow:none}
.guide-test .gt-back:focus-visible,.guide-test .gt-next:focus-visible,.guide-test .gt-again:focus-visible{outline:none;box-shadow:var(--focus-ring)}
.guide-test .gt-nojs{margin:14px 0 0;color:var(--muted)}
.guide-test .gt-result{padding:22px clamp(18px,3vw,26px);border-radius:18px;background:var(--accent-soft);border:1px solid var(--accent-line,transparent);outline:none}
@keyframes gt-in{from{opacity:0;transform:translateX(18px)}to{opacity:1;transform:none}}
@keyframes gt-in-back{from{opacity:0;transform:translateX(-18px)}to{opacity:1;transform:none}}
.guide-test .gt-q.gt-in,.guide-test .gt-result{animation:gt-in .3s ease both}
.guide-test .gt-q.gt-in-back{animation:gt-in-back .3s ease both}
.guide-test .gt-eyebrow,.guide-test .gt-skills-title{margin:0 0 4px;font-size:.78rem;font-weight:700;letter-spacing:.08em;text-transform:uppercase;color:var(--accent-text)}
.guide-test .gt-title{margin:0 0 8px;font-size:clamp(1.45rem,1.2rem + 1.1vw,1.95rem);font-weight:800;letter-spacing:-.03em;line-height:1.2}
.guide-test .gt-level p:last-child{margin:0 0 20px}
.guide-test .gt-skills{list-style:none;margin:6px 0 18px;padding:0;display:grid;gap:10px}
.guide-test .gt-skills li{display:grid;grid-template-columns:minmax(6.5em,auto) 3.8em minmax(0,1fr);gap:12px;align-items:center;margin:0}
.guide-test .gt-skill-level{font-weight:800;white-space:nowrap}
.guide-test .gt-bar{display:block;height:8px;border-radius:999px;background:var(--surface);overflow:hidden}
.guide-test .gt-bar span{display:block;height:100%;width:0;border-radius:inherit;background:var(--accent);transition:width .5s ease}
.guide-test .gt-gap,.guide-test .gt-profile{margin:0 0 12px}
.guide-test .gt-private{margin:0 0 14px;font-size:.88rem;color:var(--muted)}
.guide-test .gt-again{padding:0;border:0;background:none;color:var(--accent-text);font:inherit;font-weight:650;text-decoration:underline;text-underline-offset:3px;cursor:pointer}
@media (prefers-reduced-motion:reduce){
  .guide-test .gt-bar span,.guide-test .gt-progress span{transition:none}
  .guide-test .gt-q.gt-in,.guide-test .gt-q.gt-in-back,.guide-test .gt-result{animation:none}
}

/* The language of the phrases in a guide ("```phrase-picker", assets/js/guides.js): centred, a flag and a name each */
.guide-phrases{max-width:680px;margin:30px auto 10px;padding:20px clamp(14px,3vw,24px) 18px;border:1px solid var(--line);border-radius:22px;background:var(--surface);text-align:center;min-width:0}
.guide-phrases legend{float:left;width:100%;padding:0;margin:0 0 14px;font-weight:750;font-size:1.06rem;letter-spacing:-.01em}
.guide-phrases .gph-chips{clear:both;display:flex;flex-wrap:wrap;justify-content:center;gap:8px}
.guide-phrases .gph-chip{position:relative;display:inline-flex;align-items:center;gap:8px;min-height:44px;padding:6px 16px 6px 8px;border:1px solid var(--line);border-radius:999px;background:var(--surface);color:var(--text);cursor:pointer;font-size:.95rem;font-weight:600;line-height:1.2;transition:border-color .15s,background-color .15s;-webkit-tap-highlight-color:transparent}
.guide-phrases .gph-chip input{position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.guide-phrases .gph-chip img{flex:none;width:24px;height:24px;border-radius:50%}
.guide-phrases .gph-chip:hover{border-color:var(--accent-line,var(--accent))}
.guide-phrases .gph-chip.is-checked{border-color:var(--accent);background:var(--accent-soft);color:var(--accent-text)}
.guide-phrases .gph-chip:has(input:focus-visible){box-shadow:var(--focus-ring)}
.guide-phrases .gph-hint{margin:12px 0 0;font-size:.88rem;line-height:1.5;color:var(--muted)}
.guide-pinyin{display:block;font-weight:400;font-size:.9em;color:var(--muted)}

/* Home page block and help page block */
@media (min-width:900px){.lp-section.lp-guides{padding-top:96px;padding-bottom:104px}} /* near the bottom of the home page: a little more compact */
.lp-guides .guides-grid{margin-top:34px;grid-template-columns:repeat(auto-fit,minmax(280px,1fr))}
.lp-guides .lp-link{margin-top:28px}
.info-guides{margin-top:24px}
.info-guides ul{list-style:none;margin:6px 0 0;padding:0;display:grid;gap:10px}
.info-guides a{font-weight:600}

@media (max-width:640px){
  .guide-shell{padding:20px 16px 56px}
  .guides-grid{grid-template-columns:1fr}
  .guide-body{font-size:1.02rem}
  .guide-short{padding:16px 18px}
  .guide-test{padding:16px;border-radius:18px}
  .guide-test .gt-skills li{grid-template-columns:minmax(0,1fr) auto}
  .guide-test .gt-bar{grid-column:1/-1}
}
@media (max-width:480px){ /* the back button keeps only its arrow, so “Show the result” fits next to it */
  .guide-test .gt-back{width:48px;padding:0;justify-content:center}
  .guide-test .gt-back-text{display:none}
  .guide-test .gt-next{flex:1;padding:0 14px;font-size:.95rem}
}
