/* ============================================================================
   tf-wp.css — bridge between core block markup and the kit CSS (assets/kit/*.css, verbatim from src/kit/styles).
   Loaded on EVERY view, after the kit files. Tokens only (no hex, no font literal — K1).
   0. always-on bits the kit defines in base.css but unique pages (no kit CSS) still need
   1. WP page wrappers            2. query loop / cards        3. post-list layouts
   4. page head, categories, search, breadcrumbs, pagination   5. single        6. 404 / page
   7. default chrome (chrome/_default)
   Rule: a selector here exists only because core adds a wrapper or an element the kit markup does not have.
   ========================================================================== */

/* 0. Always-on ------------------------------------------------------------- */
.tf-float { position: fixed; inset-inline-end: var(--tf-space-4); inset-block-end: var(--tf-space-4); z-index: 50; display: grid; gap: var(--tf-space-2); }
.tf-float a { width: 3rem; height: 3rem; border-radius: 999px; display: grid; place-items: center; background: var(--tf-accent); color: var(--tf-accent-ink); text-decoration: none; font-family: var(--tf-font-label); font-size: var(--tf-label-size); box-shadow: 0 8px 24px color-mix(in oklab, var(--tf-ink) 18%, transparent); }
.tf-float a:hover { background: var(--tf-accent-2); }
.tf-float p { margin: 0; }

/* 1. Wrappers -------------------------------------------------------------- */
body.tf-kit > .wp-site-blocks { flex: 1 0 auto; display: flex; flex-direction: column; min-width: 0; }
body.tf-kit > .wp-site-blocks > main { flex: 1 0 auto; margin-block-start: 0; }
body.tf-kit > .wp-site-blocks > footer.wp-block-template-part { margin-block-start: 0; }
/* a label that is a heading (404 section titles): element styles for h2 must not restyle it */
:is(h1, h2, h3, h4).tf-label { font-family: var(--tf-font-label); font-size: var(--tf-label-size); font-weight: 500; text-transform: var(--tf-label-case); letter-spacing: var(--tf-label-tracking); line-height: 1.2; }

/* 2. Query loop + cards ---------------------------------------------------- */
.tf-main .wp-block-post-template { list-style: none; margin: 0; padding: 0; max-width: none; }
.tf-grid > li { min-width: 0; display: flex; }
.tf-grid > li > .tf-card { flex: 1 1 auto; min-width: 0; }
.tf-card__media.wp-block-post-featured-image { margin: 0; overflow: hidden; }
.tf-post__excerpt > p { margin: 0; }
.tf-label.wp-block-post-terms a, .tf-label a { color: inherit; text-decoration: none; position: relative; z-index: 1; }
.tf-label .wp-block-post-terms__separator { display: none; }
.tf-label.wp-block-post-terms a + a, .tf-label.wp-block-post-terms a ~ a { display: none; } /* kit shows ONE category */
.tf-meta .wp-block-avatar { flex: 0 0 auto; line-height: 0; }
.tf-meta .wp-block-avatar img, .tf-author .wp-block-avatar img { border-radius: 999px; object-fit: cover; background: var(--tf-surface-2); }
.tf-meta .wp-block-avatar img { width: 2.5rem; height: 2.5rem; }
.tf-meta__dot { color: var(--tf-ink-muted); }

/* 3. Post-list layouts ----------------------------------------------------- */
/* list-ruled: li > .tf-ruled (the kit puts .tf-ruled on the li) */
.tf-ruled__thumb.wp-block-post-featured-image { margin: 0; }
.tf-ruled__thumb img { width: 100%; object-fit: cover; border-radius: var(--tf-img-radius); filter: var(--tf-img-filter); }
.tf-ruled__when .tf-label { justify-self: start; }
.tf-ruled__excerpt > p { margin: 0; }

/* magazine: one inherited query, so the lead card is the first item instead of a separate component */
.tf-postlist__mag--wp > li:first-child { grid-column: 1 / -1; }
.tf-postlist__mag--wp > li:first-child .tf-post { display: grid; grid-template-columns: 1fr; }
.tf-postlist__mag--wp > li:first-child .tf-post__media { flex: none; }
.tf-postlist__mag--wp > li:first-child .tf-post__media img { aspect-ratio: 16 / 10; height: 100%; }
.tf-postlist__mag--wp > li:first-child .tf-card__body { justify-content: center; gap: var(--tf-space-4); }
.tf-postlist__mag--wp > li:first-child .tf-post__title { font-size: var(--tf-step-3); }
.tf-postlist__mag--wp > li:first-child .tf-post__excerpt { -webkit-line-clamp: 4; font-size: var(--tf-lead); line-height: 1.45; }
@media (min-width: 60rem) {
  .tf-postlist__mag--wp > li:first-child .tf-post { grid-template-columns: 7fr 5fr; }
  .tf-postlist__mag--wp > li:first-child .tf-post__media img { aspect-ratio: auto; min-height: 26rem; }
  .tf-postlist__mag--wp > li:first-child .tf-card__body { padding: var(--tf-space-6); }
}

/* sidebar */
.tf-postlist__stream-wrap { min-width: 0; }
.tf-aside__posts > li { display: block; }

/* index-table: rows are a grid (a query loop cannot emit <table>) */
.tf-index--wp { counter-reset: tf-index; }
.tf-index__head, .tf-index--wp .tf-index__row { display: grid; grid-template-columns: 3.5rem 8rem minmax(0, 1fr) 10rem 5.5rem; gap: var(--tf-space-3); align-items: start; }
.tf-index__head { padding: var(--tf-space-3); font-family: var(--tf-font-label); font-size: var(--tf-label-size); font-weight: 500; letter-spacing: var(--tf-label-tracking); text-transform: var(--tf-label-case); color: var(--tf-ink-muted); }
.tf-index__head > :last-child { text-align: end; }
.tf-index--wp .tf-index__row { padding: var(--tf-space-4) var(--tf-space-3); border-bottom: var(--tf-rule); counter-increment: tf-index; }
.tf-index--wp .tf-index__n, .tf-index--wp .tf-index__date, .tf-index--wp .tf-index__topic, .tf-index--wp .tf-index__read, .tf-index--wp .tf-index__title { width: auto; min-width: 0; }
.tf-index--wp .tf-index__n::before { content: counter(tf-index, decimal-leading-zero); }
.tf-index__t { font-size: var(--tf-step-1); line-height: 1.2; letter-spacing: var(--tf-display-tracking); }
.tf-index__t a { text-decoration: none; }
.tf-index__t a::after { content: ""; position: absolute; inset: 0; }
.tf-index__row:hover .tf-index__t a { color: var(--tf-accent-text); }
.tf-index__topic.wp-block-post-terms a { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.2em 0.7em; border: 1px solid var(--tf-line); border-radius: 999px; font-size: var(--tf-step--1); text-decoration: none; color: var(--tf-ink-muted); position: relative; z-index: 1; white-space: normal; }
.tf-index__topic .wp-block-post-terms__separator, .tf-index__topic.wp-block-post-terms a ~ a { display: none; }
[data-tf-rule="none"] .tf-index--wp > li:nth-child(even) { background: var(--tf-surface-2); }
@media (max-width: 47.99rem) {
  .tf-index__head { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
  .tf-index--wp .tf-index__row { grid-template-columns: auto 1fr; gap: var(--tf-space-2) var(--tf-space-3); padding-inline: 0; }
  .tf-index--wp .tf-index__title, .tf-index--wp .tf-index__topic, .tf-index--wp .tf-index__read { grid-column: 1 / -1; text-align: start; }
}

/* 4. Page head, categories, search, breadcrumbs, pagination ---------------- */
.tf-pagehead__intro.wp-block-term-description > p { margin: 0; }
.tf-cats__list.wp-block-categories { display: flex; flex-wrap: wrap; gap: var(--tf-space-2); list-style: none; margin: 0; padding: 0; }
.tf-cats__list .cat-item { display: inline-flex; align-items: center; gap: 0.4em; font-family: var(--tf-font-label); font-size: var(--tf-step--1); color: var(--tf-ink-muted); }
.tf-cats__list .cat-item a { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.2em 0.7em; border: 1px solid var(--tf-line); border-radius: 999px; font-family: var(--tf-font-body); text-decoration: none; color: var(--tf-ink-muted); }
.tf-cats__list .cat-item a:hover, .tf-cats__list .current-cat > a { border-color: var(--tf-accent); color: var(--tf-accent-text); }
.tf-cats--list .tf-cats__list.wp-block-categories { flex-direction: column; gap: 0; }
.tf-cats--list .tf-cats__list .cat-item { display: flex; justify-content: space-between; border-bottom: var(--tf-rule); }
.tf-cats--list .tf-cats__list .cat-item a { flex: 1 1 auto; border: 0; border-radius: 0; padding: 0.55em 0; color: var(--tf-ink); }
.tf-cats--list .tf-cats__list .cat-item a:hover, .tf-cats--list .tf-cats__list .current-cat > a { color: var(--tf-accent-text); }

.tf-search.wp-block-search { min-width: 0; max-width: 100%; }
.tf-search.wp-block-search .wp-block-search__inside-wrapper { display: flex; gap: var(--tf-space-2); border: 0; padding: 0; min-width: 0; max-width: 100%; }
.tf-nf__hero > *, .tf-pagehead > * { min-width: 0; max-width: 100%; }
.tf-search .wp-block-search__input { flex: 1 1 auto; min-width: 0; box-sizing: border-box; min-height: 3.25rem; padding: 0.6em 0.9em; background: var(--tf-surface); color: var(--tf-ink); border: 1px solid var(--tf-line); border-radius: var(--tf-radius); font-size: var(--tf-step-1); line-height: 1.4; appearance: none; }
.tf-search .wp-block-search__input:focus { outline: none; border-color: var(--tf-accent); box-shadow: 0 0 0 3px color-mix(in oklab, var(--tf-accent) 22%, transparent); }
.tf-search .wp-block-search__button { margin: 0; white-space: nowrap; cursor: pointer; }
.tf-search--compact .wp-block-search__input { font-size: var(--tf-step-0); min-height: 2.75rem; }
.tf-search--compact .wp-block-search__button { padding-inline: 1em; }

.tf-breadcrumb.wp-block-breadcrumbs { margin: 0; }
.tf-breadcrumb.wp-block-breadcrumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tf-space-2); list-style: none; margin: 0; padding: 0; }
.tf-breadcrumb.wp-block-breadcrumbs li { display: inline-flex; align-items: center; gap: var(--tf-space-2); margin: 0; }
.tf-breadcrumb.wp-block-breadcrumbs li::after { content: none; }
.tf-breadcrumb.wp-block-breadcrumbs li + li::before { content: "/"; margin: 0; opacity: 0.5; }
.tf-breadcrumb.wp-block-breadcrumbs [aria-current] { color: var(--tf-ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 22ch; }
.tf-single__hero .tf-breadcrumb.wp-block-breadcrumbs [aria-current] { color: var(--tf-dark-ink); }
[data-tf-single="classic"] .tf-single__head .tf-breadcrumb ol, [data-tf-single="wide-media"] .tf-single__head .tf-breadcrumb ol { justify-content: center; }

.tf-pagination.wp-block-query-pagination { margin-block-end: 0; }
.tf-pagination .wp-block-query-pagination-numbers { display: flex; flex-wrap: wrap; gap: var(--tf-space-2); }
.tf-pagination a > span { min-width: 0; min-height: 0; padding: 0; border: 0; display: inline; }
.tf-pagination .wp-block-query-pagination-previous, .tf-pagination .wp-block-query-pagination-next { display: inline-flex; align-items: center; gap: 0.4em; white-space: nowrap; margin: 0; }

/* 5. Single ---------------------------------------------------------------- */
.tf-single__excerpt > p { margin: 0; }
.tf-single__cover.wp-block-post-featured-image { margin-inline: 0; }
.tf-single__cover img { width: 100%; object-fit: cover; border-radius: var(--tf-img-radius); filter: var(--tf-img-filter); }
/* hero: the image is a <figure> (core/post-featured-image), the scrim a pseudo-element */
.tf-single__hero > .tf-single__hero-img { margin: 0; }
.tf-single__hero > .tf-single__hero-img img { width: 100%; height: 100%; object-fit: cover; filter: var(--tf-img-filter); }
.tf-single__hero::before { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, color-mix(in oklab, var(--tf-dark-bg) 94%, transparent) 0%, color-mix(in oklab, var(--tf-dark-bg) 62%, transparent) 55%, color-mix(in oklab, var(--tf-dark-bg) 20%, transparent) 100%); }
.tf-single__hero-inner { width: 100%; }
/* hero layout, post without a featured image → the kit's plain head */
.tf-single__hero:not(:has(.tf-single__hero-img)) { min-height: 0; padding-block-start: var(--tf-section-y); color: var(--wp--preset--color--tf-ink); --tf-ink: var(--wp--preset--color--tf-ink); --tf-ink-muted: var(--wp--preset--color--tf-ink-muted); --tf-accent-text: var(--wp--preset--color--tf-accent-text); }
.tf-single__hero:not(:has(.tf-single__hero-img))::before { content: none; }
.tf-single__hero:not(:has(.tf-single__hero-img)) .tf-single__hero-inner { padding-block: 0; }
.tf-single__hero:not(:has(.tf-single__hero-img)) .tf-single__excerpt { color: var(--tf-ink-muted); opacity: 1; }

/* prose: core/list carries a class, which the kit reset (`ul[class]`) treats as "not content" */
.tf-prose :where(ul.wp-block-list) { list-style: disc; }
.tf-prose :where(ol.wp-block-list) { list-style: decimal; }
.tf-prose > .wp-block-image, .tf-prose > .wp-block-table { margin-block: 2em; }
.tf-prose .wp-block-table table { display: table; }
.tf-prose > .wp-block-quote { margin-inline: 0; }

.tf-single__facts > div > :last-child { font-size: var(--tf-step--1); }
.tf-single__facts .wp-block-post-terms a { text-decoration: none; color: var(--tf-accent-text); }
.tf-single__tags.wp-block-post-terms a { display: inline-flex; align-items: center; min-height: 2.25rem; padding: 0.2em 0.7em; border: 1px solid var(--tf-line); border-radius: 999px; font-size: var(--tf-step--1); text-decoration: none; color: var(--tf-ink-muted); }
.tf-single__tags.wp-block-post-terms a::before { content: "#"; }
.tf-single__tags .wp-block-post-terms__separator { display: none; }
.tf-author .wp-block-avatar { line-height: 0; }
.tf-author .wp-block-avatar img { width: 4rem; height: 4rem; }
.tf-prevnext__link.wp-block-post-navigation-link { position: relative; }
.tf-prevnext__link .post-navigation-link__label { font-family: var(--tf-font-label); font-size: var(--tf-label-size); font-weight: 500; text-transform: var(--tf-label-case); letter-spacing: var(--tf-label-tracking); color: var(--tf-accent-text); }
.tf-prevnext__link a { font-family: var(--tf-font-display); font-weight: var(--tf-display-weight); font-size: var(--tf-step-1); line-height: 1.2; text-decoration: none; text-wrap: balance; }
.tf-prevnext__link a::after { content: ""; position: absolute; inset: 0; }
.tf-newsletter--band .tf-newsletter__form.wp-block-buttons { display: flex; justify-content: flex-start; }
@media (min-width: 60rem) { .tf-newsletter--band .tf-newsletter__form.wp-block-buttons { justify-content: flex-end; } }

/* 6. Search results, 404, page --------------------------------------------- */
.tf-results > li { display: block; }
.tf-result__thumb.wp-block-post-featured-image { margin: 0; }
.tf-result__thumb img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border-radius: var(--tf-img-radius); filter: var(--tf-img-filter); }
.tf-result__title a { text-decoration: none; }
.tf-result__link:not(:has(.tf-result__thumb)) { grid-template-columns: 1fr; }
.tf-result__excerpt > p { margin: 0; }
.tf-nf__search.wp-block-search { width: min(100%, 34rem); }
.tf-nf__list > li { display: block; }
.tf-nf__list .tf-nf__ptitle a { display: block; padding-block-end: var(--tf-space-1); }
.tf-nf__list .tf-nf__pmeta { padding-block-end: var(--tf-space-4); }
.tf-legal__body.wp-block-post-content { margin-inline: 0; }

/* 7. Default chrome (chrome/_default: the kit reference header/footer as blocks) */
.wp-site-blocks > header.wp-block-template-part:has(> .tf-header) { position: sticky; top: 0; z-index: 40; }
.tf-header__bar .wp-block-site-title { margin: 0; font-size: var(--tf-step-1); }
.tf-header__brand a { text-decoration: none; color: inherit; }
.tf-wpnav { font-size: var(--tf-step--1); font-weight: 500; }
.tf-wpnav .wp-block-navigation-item__content { color: var(--tf-ink-muted); }
.tf-wpnav .wp-block-navigation-item__content:hover, .tf-wpnav .current-menu-item > .wp-block-navigation-item__content { color: var(--tf-ink); }
.tf-header__bar .tf-header__cta { margin-inline-start: auto; }
@media (max-width: 47.99rem) { .tf-header__bar .tf-wpnav { margin-inline-start: auto; } }
.tf-footer p { margin: 0; }
.tf-footer__logo a { color: inherit; text-decoration: none; }

/* 8. Label numerals: core blocks cannot carry data-n, so the kit's `attr(data-n)` becomes a counter
      (page head = 01, list items restart at 01). Other labels keep the kit's glyph-only form. */
.tf-main { counter-reset: tf-n; }
.tf-main .wp-block-post-template { counter-reset: tf-n; }
.tf-main :is(.tf-pagehead, .tf-single__head, .tf-single__hero, .wp-block-post-template) .tf-label { counter-increment: tf-n; }
[data-tf-label="paren-dash"] .tf-main :is(.tf-pagehead, .tf-single__head, .tf-single__hero, .wp-block-post-template) .tf-label::before { content: "(" counter(tf-n, decimal-leading-zero) ") —"; }
[data-tf-label="slash"] .tf-main :is(.tf-pagehead, .tf-single__head, .tf-single__hero, .wp-block-post-template) .tf-label::before { content: counter(tf-n, decimal-leading-zero) " /"; }
[data-tf-label="arrow"] .tf-main :is(.tf-pagehead, .tf-single__head, .tf-single__hero, .wp-block-post-template) .tf-label::after { content: counter(tf-n, decimal-leading-zero); opacity: 0.6; }
[data-tf-label="bracket"] .tf-main :is(.tf-pagehead, .tf-single__head, .tf-single__hero, .wp-block-post-template) .tf-label::before { content: "[" counter(tf-n, decimal-leading-zero) "]"; }
[data-tf-label="bracket"] .tf-main :is(.tf-pagehead, .tf-single__head, .tf-single__hero, .wp-block-post-template) .tf-label::after { content: none; }

/* 9. Contact Form 7 (markup from the bake's seed.cf7_form: kit Contact page + per-template `forms`).
      Structure on every view; unique pages take the look from the author's residue on the form's group.
      Kit pages (Contact) get the kit look from the kit classes the markup also carries (tf-field, tf-input,
      tf-form__grid/__actions, tf-field__req/__hint in base.css / util.css) + the rest below, tokens only. */
.tf-cf7-grid { display: grid; gap: var(--tf-space-4); grid-template-columns: minmax(0, 1fr); }
@media (min-width: 40rem) { .tf-cf7-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } .tf-cf7-field--full { grid-column: 1 / -1; } }
.tf-cf7-field { display: grid; gap: var(--tf-space-2); min-width: 0; align-content: start; }
.tf-cf7-field > label { display: block; }
.wpcf7 .tf-cf7-field .wpcf7-form-control-wrap { display: block; }
.wpcf7 .tf-cf7-field .wpcf7-form-control { box-sizing: border-box; width: 100%; max-width: 100%; }
.tf-cf7-hint, .tf-cf7-note { margin: 0; }
.tf-cf7-consent { margin-block-start: var(--tf-space-4); }
.tf-cf7-consent .wpcf7-list-item { display: block; margin: 0; }
.tf-cf7-consent label { display: flex; gap: var(--tf-space-2); align-items: flex-start; cursor: pointer; }
.tf-cf7-consent input[type="checkbox"] { flex: none; margin: 0.3em 0 0; accent-color: var(--tf-accent); }
.tf-cf7-actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--tf-space-4); margin-block-start: var(--tf-space-5); }
.tf-cf7-actions .wpcf7-spinner { margin: 0; }
/* CF7's spinner blinks forever while hidden (and under reduced motion): only animate while submitting */
.wpcf7 form:not(.submitting) .wpcf7-spinner::before { animation: none; }
/* the hidden spinner still takes a box: next to a full-width submit it wraps to its own row (+40px) */
.wpcf7 form:not(.submitting) .tf-cf7-actions .wpcf7-spinner { display: none; }
@media (prefers-reduced-motion: reduce) { .wpcf7 .wpcf7-spinner::before { animation: none; } }
input.tf-cf7-submit { cursor: pointer; appearance: none; -webkit-appearance: none; }
.wpcf7 form .wpcf7-response-output { margin: var(--tf-space-4) 0 0; padding: var(--tf-space-3) var(--tf-space-4); border: 1px solid var(--tf-line); border-radius: var(--tf-radius); }
.wpcf7 form.sent .wpcf7-response-output { border-color: var(--tf-accent); }
.wpcf7 form:is(.invalid, .unaccepted, .payment-required, .failed, .aborted, .spam) .wpcf7-response-output { border-color: var(--tf-sale); }
.wpcf7 .wpcf7-not-valid-tip { color: var(--tf-sale); font-size: var(--tf-step--1); margin-block-start: var(--tf-space-1); }
.wpcf7 .wpcf7-not-valid { border-color: var(--tf-sale); }
body.tf-kit .tf-cf7-consent { font-size: var(--tf-step--1); color: var(--tf-ink-muted); max-width: var(--tf-measure); }
body.tf-kit .tf-cf7-note { font-size: var(--tf-step--1); }
body.tf-kit .tf-prose .wpcf7 { margin-block-start: var(--tf-space-6); max-width: 46rem; }
body.tf-kit .tf-prose .wpcf7 :is(label, p) { margin: 0; }
