/* ==========================================================================
   core.css: the core pages in the Exercise Book look (restyle ticket 08)
   Home, About, How it works, Pricing, Testimonials, Privacy, 404 and the 听写 reader name it in front matter
   (extra_css: [core]). Everything else comes from site.css; colours only through its tokens.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Page template (home, 404): the page's own sections sit in the reading column, or the wide one on the home page
   -------------------------------------------------------------------------- */
.page-main { display: block; }
.column-wide { max-width: calc(1040px + 2 * var(--gutter)); }
/* The header and footer line up with a wide page (the home page) instead of the reading column. */
body:has(.column-wide) .site-header-inner, body:has(.column-wide) .site-footer-inner { max-width: calc(1040px + 2 * var(--gutter)); }

/* --------------------------------------------------------------------------
   Home: the intro on the practice grid, the three tools, the reviews
   -------------------------------------------------------------------------- */
.home-intro { padding-top: 28px; padding-bottom: 28px; }
.home-intro h1 { margin-top: 0; }
.home-intro .sub { max-width: 34em; }

.home-section > h2 { margin-top: 44px; }
.home-section > .lede { max-width: 40em; color: var(--muted); }

/* The tools: a ruled list on a phone, three ruled columns on a laptop. */
.tools { list-style: none; margin: 0; padding: 0; }
.tool { margin: 0; padding: 18px 0 22px; border-bottom: 1px solid var(--soft); }
.tool:last-child { border-bottom: 0; }
.tool .kicker { margin-bottom: 6px; }
.tool h3 { margin: 0 0 8px; font-size: 23px; }
.tool-desc { margin: 0 0 12px; }
.tool-features { margin: 0 0 16px; padding-left: 1.1em; color: var(--muted); font-size: 15px; }
.tool-features li { margin: .2em 0; }
.tool-link { font-weight: 700; }
.tool-link::after { content: "\00a0\2192"; }

/* The reviews: three ruled lists of links. */
.resource-group h3 { margin: 28px 0 0; padding-bottom: 8px; font-size: 19px; border-bottom: 2px solid var(--ink); }
.resource-group .ruled-list { border-top: 0; }
.resource-group .ruled-title { font-size: 17px; }

@media (min-width: 900px) {
    .tools, .resource-groups { display: grid; grid-template-columns: repeat(3, 1fr); column-gap: 40px; }
    .tool { padding: 16px 0 0; border-bottom: 0; border-top: 1px solid var(--soft); }
    .tool:last-child { border-bottom: 0; }
    .home-section > h2 + .tools { margin-top: 4px; }
}

/* --------------------------------------------------------------------------
   Shared pieces of the article pages
   -------------------------------------------------------------------------- */
/* Two buttons side by side on a laptop, stacked on a phone (the ruled .note and the .cta-note under the buttons
   are site.css's). */
.cta-buttons { display: flex; flex-direction: column; gap: 10px; margin: 0 0 14px; }
@media (min-width: 600px) {
    .cta-buttons { flex-direction: row; flex-wrap: wrap; }
    .cta-buttons .btn { min-width: 0; }
}

.contact-line { margin-top: 28px; }

/* --------------------------------------------------------------------------
   About: the six principles
   -------------------------------------------------------------------------- */
.principle { margin: 0; padding: 4px 0 10px; border-bottom: 1px solid var(--soft); }
.principle h3 { margin-top: 22px; margin-bottom: 4px; }
.principle .source { margin: 0 0 12px; font-size: 14px; color: var(--muted); }

/* --------------------------------------------------------------------------
   How it works: what's in the deck, the three steps
   -------------------------------------------------------------------------- */
.features { list-style: none; margin: 8px 0 20px; padding: 0; }
.feature {
    display: grid;
    grid-template-columns: 64px 1fr;
    gap: 14px;
    align-items: start;
    margin: 0;
    padding: 14px 0;
    border-bottom: 1px solid var(--soft);
}
/* The character in a 田字格 practice box (the grid lines come from site.css .practice-grid-bg). */
.feature-mark {
    display: grid;
    place-items: center;
    width: 64px;
    aspect-ratio: 1;
    border: 1.5px solid var(--ink);
    font: 700 30px/1 var(--zh);
    color: var(--ink);
}
.feature-mark.small { font: 700 15px/1 var(--serif); white-space: nowrap; }
.feature-mark.two { font-size: 22px; }
.feature h3 { margin: 2px 0 4px; font-size: 18px; }
.feature p { margin: 0; font-size: 15px; color: var(--muted); }

.steps { list-style: none; margin: 8px 0 24px; padding: 0; }
.step {
    display: grid;
    grid-template-columns: 44px 1fr;
    gap: 14px;
    margin: 0;
    padding: 16px 0;
    border-bottom: 1px solid var(--soft);
}
.step-number { font: 700 34px/1 var(--serif); color: var(--red); }
.step h3 { margin: 2px 0 6px; }
.step p { margin: 0 0 8px; }

/* The three steps again, in one ruled strip. */
.flow { display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; margin: 24px 0; padding: 0; border: 1.5px solid var(--ink); }
.flow li { margin: 0; padding: 12px 10px; border-right: 1.5px solid var(--ink); font: 600 15px/1.3 var(--sans); color: var(--ink); }
.flow li:last-child { border-right: 0; }
.flow b { display: block; margin-bottom: 4px; font: 700 22px/1 var(--serif); color: var(--red); }

/* --------------------------------------------------------------------------
   Pricing: the two plans, the cost table, what's included, the questions
   -------------------------------------------------------------------------- */
.plan { padding-bottom: 8px; }
.plan > h2 { margin-bottom: 4px; }
.price { margin: 4px 0 2px; font: 700 40px/1.1 var(--serif); color: var(--ink); }
.plan-note { margin: 0 0 12px; font-size: 15px; color: var(--muted); }
.plan .check { margin-bottom: 18px; }
.plan .btn + .plan-note { margin-top: 18px; margin-bottom: 8px; }
.plan .practice-boxes { margin-bottom: 8px; }
.plan .practice-boxes > a { aspect-ratio: auto; min-height: 52px; font-size: 20px; }

.cost-table td:first-child { width: 62%; }
.cost-table td.good, .cost-table td.bad { font: 700 17px/1.3 var(--serif); white-space: nowrap; }
.cost-detail { display: block; font-size: 14px; color: var(--muted); }

@media (min-width: 600px) {
    .check.included { column-count: 2; column-gap: 28px; }
    .check.included > li { break-inside: avoid; }
}

.faq-item { padding: 2px 0 6px; border-bottom: 1px solid var(--soft); }
.faq-question { margin: 18px 0 6px; font-size: 18px; }

/* --------------------------------------------------------------------------
   Testimonials: each message a quote with the red margin rule
   -------------------------------------------------------------------------- */
.quote .kicker { margin: 0 0 6px; font-style: normal; }

/* --------------------------------------------------------------------------
   404
   -------------------------------------------------------------------------- */
.page-404 .page-hero { padding-left: 0; padding-right: 0; }
.page-404 .page-hero .kicker { font-size: 14px; }
.page-404 > h2 { margin-top: 44px; }

/* --------------------------------------------------------------------------
   The 听写 reader: the form, then one ruled row per word
   -------------------------------------------------------------------------- */
.tx-form { margin: 8px 0 0; padding: 0; }
.tx-form label { display: block; margin-bottom: 8px; }
.tx-form textarea { min-height: 120px; resize: vertical; font: 400 22px/1.6 var(--zh); }
.tx-hint { margin: 8px 0 0; font-size: 14px; color: var(--muted); }
.tx-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 16px; }
.tx-actions .btn { flex: 1 1 100%; }
.tx-example {
    padding: 4px 0;
    border: 0;
    background: none;
    font: 600 15px/1.3 var(--sans);
    color: var(--red);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
}
@media (min-width: 600px) { .tx-actions .btn { flex: 0 0 auto; } }
#tx-turnstile { margin-top: 12px; }
.tx-status { min-height: 1.5em; margin: 12px 0 0; font-size: 15px; color: var(--muted); }
.tx-status.error { color: var(--red); }

.tx-results { margin-top: 24px; }
.tx-results:not(:empty) { border-top: 2px solid var(--ink); }
.tx-card { display: flex; gap: 14px; align-items: flex-start; min-width: 0; padding: 14px 0; border-bottom: 1px solid var(--soft); }
.tx-card.open { flex-direction: column; }
.tx-pic { flex: none; width: 120px; aspect-ratio: 4 / 3; object-fit: cover; background: var(--soft); cursor: zoom-in; }
.tx-card.open .tx-pic { width: 100%; cursor: zoom-out; }
.tx-body { flex: 1; min-width: 0; }
.tx-head { display: flex; align-items: center; gap: 12px; }
.tx-word { font: 500 32px/1.2 var(--zh); color: var(--text); }
/* The play button: a small square in cobalt, filled while its clip plays. */
.tx-play {
    flex: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1.5px solid var(--ink);
    border-radius: 0;
    background: transparent;
    color: var(--ink);
    cursor: pointer;
}
.tx-play svg { width: 18px; height: 18px; fill: currentColor; margin-left: 2px; }
.tx-play:hover { background: var(--soft); }
.tx-play.playing { background: var(--ink); color: var(--paper); }
.tx-pinyin { font: 600 17px/1.4 var(--sans); color: var(--ink); }
.tx-english { font-size: 16px; overflow-wrap: anywhere; }
.tx-where { list-style: none; margin: 8px 0 0; padding: 0; font-size: 13px; color: var(--muted); }
.tx-where li { margin: 0; padding: 2px 0; }
.tx-where b { color: var(--text); }
.tx-note { margin: 6px 0 0; font-size: 14px; color: var(--muted); }
/* A word that splits into its characters: the parts indented under a cobalt rule. */
.tx-group { flex-direction: column; }
.tx-group > .tx-body { width: 100%; }
.tx-parts { margin: 10px 0 0; padding-left: 14px; border-left: 1.5px solid var(--ink); }
.tx-parts .tx-card:last-child { border-bottom: 0; }
.tx-missing { align-items: center; }
.tx-missing .tx-word { font-size: 26px; }
@media (max-width: 599px) {
    .tx-pic { width: 96px; }
    .tx-word { font-size: 28px; }
}

.tx-more { margin: 20px 0 0; padding: 12px 0 12px 14px; border-left: 3px solid var(--ink); font-size: 15px; }
.tx-more a { font-weight: 700; }
