/* The chore guides (/chores/).  Built on the marketing shell's .page-hero,
   .prose and .btn; this file holds only what an article with tables needs
   on top of them.  Tokens come from partials/_marketing_styles.html, which
   is also where their dark-mode values live. */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

/* ── Hero ── */
.guide-hero { padding-bottom: 1.5rem; }

.guide-crumbs { margin-bottom: 1.25rem; font-size: 0.85rem; }
.guide-crumbs ol {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.25rem 0.5rem;
}
.guide-crumbs li { color: var(--text-muted); }
.guide-crumbs li + li::before { content: "›"; margin-right: 0.5rem; color: var(--text-dim); }
.guide-crumbs a { color: var(--text-soft); text-decoration: none; }
.guide-crumbs a:hover { color: var(--blue); text-decoration: underline; }

.guide-facts {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.5rem;
}
.guide-facts li {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 0.35rem 0.9rem;
    font-size: 0.9rem;
    color: var(--text-soft);
}
.guide-facts strong { color: var(--text-head); }

/* ── Article ──
   Wider than .prose's 68ch (the legal pages' measure) because these pages
   are mostly tables, and 780px is what the other marketing pages already
   use for their content blocks (.check-cols, .also).  Body text still runs
   about 80 characters a line; any wider and it stops being comfortable. */
.guide-body { padding-top: 1.5rem; }
.prose.guide { max-width: 780px; }
.guide > p:first-of-type { font-size: 1.05rem; }

/* ── Chore tables ──
   Three columns fit a 360px phone because the long column wraps and the
   two numbers never do.  The wrapper scrolls rather than the page if a
   future title is ever unbreakable. */
.chore-table-wrap { overflow-x: auto; margin: 1rem 0 0.5rem; }
.chore-table {
    width: 100%;
    border-collapse: collapse;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
    font-size: 0.97rem;
}
.chore-table th, .chore-table td {
    padding: 0.7rem 0.9rem;
    text-align: left;
    vertical-align: top;
    border-bottom: 1px solid var(--border);
}
.chore-table tbody tr:last-child th,
.chore-table tbody tr:last-child td { border-bottom: 0; }
.chore-table thead th {
    background: var(--surface-2);
    color: var(--text-muted);
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}
.chore-table tbody th { color: var(--text); font-weight: 600; }
.chore-table td { color: var(--text-soft); }
.chore-table .chore-num { white-space: nowrap; text-align: right; }
.chore-meta, .chore-note {
    display: block;
    font-weight: 400;
    font-size: 0.83rem;
    margin-top: 0.15rem;
}
.chore-meta { color: var(--text-muted); }
.chore-note { color: var(--text-soft); }

.age-chart tbody th { white-space: nowrap; }
.age-chart tbody th a { color: var(--blue); font-weight: 800; text-decoration: none; }
.age-chart tbody th a:hover { text-decoration: underline; }

/* ── Inline CTA ──
   Quieter than the green banner at the foot of the page: the reader is
   halfway through an article and this is an aside, not an interruption. */
.guide-cta {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--tint-green);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    margin: 2.5rem 0 0.5rem;
}
.guide-cta img { flex: none; width: 56px; height: auto; }
.guide-cta p { margin-bottom: 0.9rem; }
.guide-cta .btn { white-space: normal; text-align: center; }
/* .prose a would otherwise paint the button's label link-blue on green. */
.prose .guide-cta .btn-green { color: #fff; text-decoration: none; }

/* ── Links between ages ── */
.guide-pager {
    display: flex;
    gap: 0.75rem;
    margin-top: 2.5rem;
}
.guide-pager a {
    flex: 1;
    display: block;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.85rem 1.1rem;
    font-weight: 700;
    text-decoration: none;
}
.guide-pager a:hover { border-color: var(--blue); }
.guide-pager span {
    display: block;
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
}
.guide-pager-next { text-align: right; margin-left: auto; }

.prose .guide-ages-head { font-size: 1.05rem; margin-top: 2rem; }
.prose .guide-ages {
    list-style: none;
    margin: 0.75rem 0 0;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}
.prose .guide-ages li { font-size: 0.9rem; }
.guide-ages a, .guide-ages span {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--surface);
    text-decoration: none;
    font-weight: 700;
}
.guide-ages span { background: var(--tint-blue); color: var(--blue); border-color: transparent; }

.prose .guide-index { list-style: none; margin-left: 0; gap: 0.6rem; }
.guide-index a { font-weight: 700; margin-right: 0.35rem; }

@media (max-width: 640px) {
    .chore-table th, .chore-table td { padding: 0.6rem 0.65rem; }
    .guide-cta { flex-direction: column; }
    .guide-pager { flex-direction: column; }
    .guide-pager-next { text-align: left; }
}

/* ── Dates and sources ──
   Small print on purpose: they are there for the reader who wants to
   check, and for search engines judging whether the page can be trusted. */
.guide-updated { margin-top: 1rem; font-size: 0.82rem; color: var(--text-muted); }
.guide-cite { font-size: 0.85rem; color: var(--text-muted); }
.prose .guide-sources-head { font-size: 1.05rem; margin-top: 2.5rem; }
.prose .guide-sources-intro { font-size: 0.9rem; }
.prose .guide-sources { gap: 0.35rem; }
.prose .guide-sources li { font-size: 0.85rem; color: var(--text-muted); }
.guide-sources a { overflow-wrap: anywhere; }

/* ── Printables: the on-screen preview ──
   The sheet is drawn with outlines only, so the preview on screen is the
   page that comes out of the printer. */
.print-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.5rem 1rem;
    margin: 1rem 0;
}
.print-actions .btn { cursor: pointer; border: 0; font: inherit; font-weight: 700; }
.print-hint { font-size: 0.85rem; color: var(--text-muted); }

.print-sheet {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1.25rem;
    margin: 0 0 2.5rem;
    box-shadow: var(--shadow-card);
}
.sheet-head {
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 0.5rem 1.5rem;
    margin-bottom: 0.9rem;
}
.prose .sheet-head p { margin: 0; }
.sheet-title { font-size: 1.25rem; font-weight: 900; color: var(--text-head); margin-right: auto; }
.prose .sheet-field { font-size: 0.9rem; color: var(--text-soft); }
.sheet-field span {
    display: inline-block;
    width: 9rem;
    border-bottom: 1px solid var(--text-muted);
    margin-left: 0.3rem;
}
.sheet-grid { width: 100%; border-collapse: collapse; font-size: 0.9rem; }
.sheet-grid th, .sheet-grid td {
    border: 1px solid var(--border);
    padding: 0.4rem 0.5rem;
    text-align: center;
    color: var(--text);
}
.sheet-grid thead th { font-size: 0.75rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.04em; color: var(--text-muted); }
.sheet-grid .sheet-chore { text-align: left; font-weight: 600; min-width: 12rem; }
.sheet-grid thead .sheet-chore { color: var(--text-muted); }
.sheet-pts { width: 3.5rem; color: var(--text-soft); }
.sheet-box { width: 3rem; height: 2rem; }
.sheet-blank .sheet-chore { height: 2rem; }
.sheet-section th {
    text-align: left;
    font-size: 0.75rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--text-muted);
    background: var(--surface-2);
}
.sheet-total { height: 2rem; }
.prose .sheet-foot { margin-top: 0.6rem; font-size: 0.75rem; color: var(--text-muted); text-align: right; }

.prose .printable-list { list-style: none; margin-left: 0; gap: 0.75rem; }
.printable-list a { font-weight: 800; display: block; }
.printable-list span { color: var(--text-soft); font-size: 0.95rem; }

.guide-print-link {
    background: var(--surface);
    border: 1px dashed var(--border);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin-top: 1rem;
}

/* ── Printables: on paper ──
   Only the chart prints.  Everything else on the page, the site's nav and
   footer included, is display: none, so the sheet starts at the top of the
   first page.  Black outlines on white rather than the theme's colours,
   because browsers drop backgrounds when printing and a dark-mode token
   would print grey on grey.  No paper size is named, so Letter and A4 both
   work; landscape is what fits seven day columns. */
@media print {
    @page { size: landscape; margin: 0.4in; }

    nav, footer, .cta-section, .guide-hero, .guide > :not(.print-sheet):not(.generator),
    .print-skip { display: none !important; }

    /* The marketing shell hides horizontal overflow, which on paper
       shaved off the grid's outer border (a collapsed border sits half
       outside the table). */
    body { background: #fff; overflow: visible; }
    section.guide-body { padding: 0; }
    .guide-body .wrap { max-width: none; padding: 0; }
    .prose.guide { max-width: none; }

    .print-sheet {
        border: 0;
        box-shadow: none;
        padding: 0 1px;
        margin: 0;
        break-inside: avoid;
    }
    .print-sheet + .print-sheet { break-before: page; }
    .chore-table-wrap { overflow: visible; }

    /* Everything on the sheet, not a list of its parts: a list missed the
       <strong> in the teen agreement, which kept its dark-mode token and
       printed light grey. */
    .print-sheet, .print-sheet * { color: #000 !important; }
    .sheet-grid th, .sheet-grid td, .sheet-section th { background: none !important; }
    .sheet-grid th, .sheet-grid td { border-color: #000; }
    .sheet-field span { border-color: #000; }
    /* Nineteen rows on the fullest chart: 0.3in each keeps it on one A4
       page, the shorter of the two sizes, with room to spare. */
    .sheet-grid { font-size: 10.5pt; }
    .sheet-grid th, .sheet-grid td { padding: 0.15rem 0.4rem; }
    .sheet-box, .sheet-blank .sheet-chore, .sheet-total { height: 0.3in; }
    .print-sheet .sheet-foot { color: #444 !important; }
}

/* ── Allowance guides ── */
.allowance-age { white-space: nowrap; }
.chore-table .allowance-amount { font-weight: 700; color: var(--text); }
.compare-table td { color: var(--text-soft); }
.compare-table tbody th { white-space: normal; min-width: 8rem; }

/* ── Teen allowance sheet ──
   An agreement rather than a grid: two columns (what it covers, extra
   jobs) above a four week tracker, all on one landscape page. */
.prose .sheet-typical { font-size: 0.85rem; margin: 0 0 0.8rem; }
.sheet-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.25rem;
    margin-bottom: 0.9rem;
}
.prose .sheet-label { font-size: 0.9rem; color: var(--text); margin: 0 0 0.5rem; }
.sheet-blank-line {
    display: inline-block;
    width: 6rem;
    border-bottom: 1px solid var(--text-muted);
    vertical-align: baseline;
}
.sheet-blank-line.short { width: 2.5rem; }
.sheet-blank-line.wide { width: 10rem; }
.prose .sheet-checks {
    list-style: none;
    margin: 0 0 0.6rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.3rem 0.8rem;
}
.prose .sheet-checks li { font-size: 0.85rem; color: var(--text); display: flex; gap: 0.4rem; align-items: center; }
.sheet-checks li::before {
    content: "";
    flex: none;
    width: 0.8rem;
    height: 0.8rem;
    border: 1px solid var(--text-muted);
    border-radius: 2px;
}
.sheet-pay { width: 5rem; text-align: left !important; color: var(--text-soft); }
.sheet-tracker .sheet-box { width: auto; }
.prose .sheet-sign { font-size: 0.85rem; margin: 0.8rem 0 0; }
.sheet-sign .sheet-blank-line { width: 12rem; }

@media (max-width: 640px) {
    .sheet-cols, .prose .sheet-checks { grid-template-columns: 1fr; }
}

@media print {
    .sheet-cols { grid-template-columns: 1fr 1fr; }
    .prose .sheet-checks { grid-template-columns: 1fr 1fr; }
    .sheet-blank-line, .sheet-checks li::before { border-color: #000; }
}

/* A paragraph straight after a list: .prose only spaces p after p. */
.guide ul + p, .guide ol + p { margin-top: 0.9rem; }

/* ── The chore list generator ── */
.generator {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    margin: 0 0 2rem;
    box-shadow: var(--shadow-card);
}
.prose .generator h2:first-child { margin-top: 0; }
.generator-row {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 9rem auto;
    gap: 0.75rem;
    align-items: end;
    margin-bottom: 0.75rem;
}
.generator-row label { display: grid; gap: 0.25rem; }
.generator-row label span { font-size: 0.8rem; font-weight: 700; color: var(--text-muted); }
.generator-row input, .generator-row select {
    font: inherit;
    font-size: 1rem;
    color: var(--text);
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.55rem 0.7rem;
    width: 100%;
}
.generator-row input:focus, .generator-row select:focus { outline: 2px solid var(--blue); outline-offset: 1px; }
.generator-remove {
    font: inherit;
    font-size: 0.85rem;
    color: var(--text-soft);
    background: none;
    border: 0;
    padding: 0.6rem 0.2rem;
    cursor: pointer;
    text-decoration: underline;
}
.generator-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-top: 0.5rem; }
.generator-actions .btn, .generator-load .btn { border: 0; font: inherit; font-weight: 700; cursor: pointer; }

.generator-results { margin-top: 1.5rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.prose .generator-hint { font-size: 0.9rem; }
.generator-card {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
    margin-top: 1rem;
}
.prose .generator-card h3 { margin: 0; font-size: 1.1rem; }
.prose .generator-card-age { font-size: 0.85rem; color: var(--text-muted); margin: 0.1rem 0 0.4rem; }
.prose .generator-card h4 {
    font-size: 0.75rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--text-muted);
    margin: 0.9rem 0 0.35rem;
}
.prose .generator-chores { list-style: none; margin: 0; gap: 0.2rem; }
.generator-chores label {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.6rem;
    align-items: baseline;
    cursor: pointer;
    padding: 0.2rem 0;
}
.generator-chores input { accent-color: var(--blue); }
.generator-chore-title { color: var(--text); font-size: 0.95rem; }
.generator-chore-meta { color: var(--text-muted); font-size: 0.8rem; white-space: nowrap; }
.prose .generator-totals {
    margin-top: 0.8rem;
    padding-top: 0.6rem;
    border-top: 1px dashed var(--border);
    font-size: 0.9rem;
    font-weight: 700;
    color: var(--text);
}

.prose .generator-error { color: var(--pink); font-weight: 700; }

@media (max-width: 640px) {
    .generator { padding: 1rem; }
    .generator-row { grid-template-columns: minmax(0, 1fr) 7rem; }
    .generator-remove { grid-column: 1 / -1; justify-self: start; padding: 0; }
    .generator-chores label { grid-template-columns: auto minmax(0, 1fr); }
    .generator-chore-meta { grid-column: 2; }
}

/* ── Generator: explaining itself ── */
.prose .generator-steps {
    list-style: none;
    margin: 1rem 0 1.5rem;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    counter-reset: gen-step;
}
.generator-steps li {
    counter-increment: gen-step;
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem;
}
.generator-steps li::before {
    content: counter(gen-step);
    display: grid;
    place-items: center;
    width: 2rem;
    height: 2rem;
    border-radius: 50%;
    background: var(--tint-blue);
    color: var(--blue);
    font-weight: 900;
    margin-bottom: 0.5rem;
}
.prose .generator-steps h3 { margin: 0 0 0.25rem; }
.prose .generator-steps p { font-size: 0.92rem; }

.generator-step-num {
    display: inline-grid;
    place-items: center;
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    background: var(--blue);
    color: #fff;
    font-size: 0.95rem;
    margin-right: 0.35rem;
    vertical-align: 0.1em;
}
.prose .generator-hint { font-size: 0.9rem; margin: -0.2rem 0 0.9rem; }

.generator-key {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1.25rem;
    background: var(--surface-2);
    border-radius: 12px;
    padding: 0.8rem 1rem;
    margin: 0.5rem 0 0.5rem;
}
.generator-key dt { font-weight: 800; font-size: 0.85rem; color: var(--text-head); }
.generator-key dd { font-size: 0.85rem; color: var(--text-soft); margin: 0; }

.generator-use { margin-top: 1.75rem; border-top: 1px solid var(--border); padding-top: 0.5rem; }
.generator-choices {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
    gap: 1rem;
    align-items: start;
}
.generator-choice {
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 1rem 1.1rem;
}
.prose .generator-choice h3 { margin: 0 0 0.35rem; }
.prose .generator-choice p { font-size: 0.9rem; }
.generator-choice .btn { margin-top: 0.8rem; border: 0; font: inherit; font-weight: 700; cursor: pointer; }
.prose .generator-load-steps { margin: 0.3rem 0 0 1.1rem; gap: 0.3rem; }
.prose .generator-load-steps li { font-size: 0.9rem; }
.prose .generator-login { margin-top: 0.7rem; font-size: 0.85rem; }

/* ── Generator: the offer on other pages ── */
.generator-promo {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    background: var(--tint-blue);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 1.25rem 1.4rem;
    margin: 1.5rem 0;
}
.generator-promo img { flex: none; width: 64px; height: auto; }
.prose .generator-promo-title { font-size: 1.15rem; font-weight: 900; color: var(--text-head); margin-bottom: 0.3rem; }
.prose .generator-promo p { font-size: 0.95rem; }
.generator-promo .btn { margin-top: 0.8rem; }
.prose .generator-promo a.btn { color: #fff; text-decoration: none; }

@media (max-width: 760px) {
    .prose .generator-steps, .generator-choices, .generator-key { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
    .generator-promo { flex-direction: column; }
}

/* ── Generator: "Print these charts" ──
   The script builds a band-style weekly chart for each child into
   .generator-sheets, which exists only on paper: the cards above are what
   the parent edits, and a second copy of the same chores on screen would
   only be something to scroll past.  The sheets are .print-sheet, so every
   print rule above (landscape, black outlines, one child to a page) is
   theirs too; nothing of the generator itself prints. */
.generator-sheets { display: none; }
/* A typed name sits on the line; a long one pushes it rather than
   overflowing the head. */
.generator-sheets .sheet-field span { width: auto; min-width: 9rem; }

@media print {
    .generator { border: 0; box-shadow: none; padding: 0; margin: 0; }
    .generator > :not(.generator-sheets) { display: none !important; }
    .generator-sheets { display: block; }
}
