/*
Theme Name: DocsPress Linchpin
Theme URI: https://linchpin.com
Template: docspress
Author: Linchpin
Author URI: https://linchpin.com
Description: Linchpin-branded child theme for DocsPress. Overrides colour, typography and button styling only; all documentation behaviour (navigation tree, table of contents, llms.txt endpoints, GitHub edit links, versioning) is inherited from the parent.
Version: 0.1.0
Requires at least: 6.6
Requires PHP: 8.5
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: docspress-linchpin
*/

/*
 * Kept as small as possible.
 *
 * The parent maps every one of its --dp-* tokens to a theme.json value
 * (var(--wp--preset--color--<slug>, fallback) or var(--wp--custom--<token>,
 * fallback)), so re-declaring those slugs in this child's theme.json restyles
 * the parent's stylesheet without any CSS here. Add rules below only for things
 * theme.json genuinely cannot express.
 *
 * Note: the parent enqueues its stylesheet via get_stylesheet_uri(), which
 * resolves to THIS file once a child is active. includes/enqueue.php loads the
 * parent's style.css explicitly so its 4,255 lines are not dropped.
 */

/*
 * Font weight normalisation.
 *
 * The parent hardcodes 560/650/720/750/850 in its stylesheet rather than
 * routing them through a token, so theme.json cannot reach them. Those values
 * are tuned for Nunito Sans; Mozaic GEO carries noticeably more optical weight
 * at the same numeric value, so they read as muddled half-steps and none of
 * them land on the brand scale. Map each onto the nearest brand step:
 *
 *   560 -> 500 medium      650, 720 -> 600 semi-bold
 *   750 -> 700 bold        850      -> 800 extra-bold
 *
 * These selectors are copied from the parent verbatim. The child stylesheet is
 * enqueued after the parent's, so equal specificity is enough — no !important.
 */

/* Single-class descendant selectors first, to keep specificity ascending. */
.docs-nav a {
	font-weight: var(--wp--custom--font-weight--medium);
}

.home-feature-copy a {
	font-weight: var(--wp--custom--font-weight--bold);
}

.breadcrumbs,
.entry-content th,
.pagination-title,
.docs-nav > ul > li > a,
.docs-nav > ul > li > .docs-nav-row > a,
.command-search-result-title {
	font-weight: var(--wp--custom--font-weight--semi-bold);
}

.docs-nav a[aria-current="page"],
.toc-list a.is-active,
.pagination-direction,
.command-search-status,
.command-search-result-path,
.home-download-card__preview {
	font-weight: var(--wp--custom--font-weight--bold);
}

.home-section-kicker,
.comments-area .wp-block-comment-author-name,
:where(.comments-area) :where(.comments-title) {
	font-weight: var(--wp--custom--font-weight--extra-bold);
}

/*
 * Content headings are pinned to 750 by the parent, which overrides the 800
 * that theme.json sets via --wp--custom--heading-weight. Restore the brand
 * weight; h1 is left alone because the parent already tokenises it.
 */
.entry-content :where(h2),
.entry-content :where(h3),
.entry-content :where(h4) {
	font-weight: var(--wp--custom--heading-weight);
}

/*
 * Flare button (the offset magenta/teal pair behind a light pill, as used on
 * linchpin.com and builditbelieveit.com).
 *
 * themes/linchpin ships this as a registered `button-flare-light` block style
 * variation, which needs a register_block_style() call. This child theme has no
 * block-style registration, and core/button's `shadow` attribute serialises to
 * nothing here — the editor strips the inline box-shadow during validation and
 * the attribute alone emits no CSS, so the shadow silently disappears. Driving
 * it from a className keeps the markup valid in the editor AND renders.
 */
.wp-block-button.is-flare > .wp-block-button__link {
	box-shadow: var(--wp--preset--shadow--flare);
	transition: box-shadow 0.15s ease-out;
}

.wp-block-button.is-flare > .wp-block-button__link:hover,
.wp-block-button.is-flare > .wp-block-button__link:focus-visible {
	box-shadow: var(--wp--preset--shadow--flare-hover);
}

/*
 * Footer boundary in dark mode.
 *
 * The footer is deliberately a dark ink surface so it reads as a distinct band
 * under the light theme. Under the dark theme the page background is that same
 * ink, so the footer and the content above it become the identical colour and
 * the boundary disappears entirely — text contrast stays fine, but the footer
 * stops looking like a footer. A hairline in the same colour as the footer's
 * own rule restores the separation. Scoped to dark only: in light mode the
 * light page against the dark band is already boundary enough, and a line
 * there just reads as an artefact.
 */
[data-theme="dark"] .linchpin-footer {
	border-top: 1px solid var(--wp--preset--color--dark-line);
}

/*
 * Note on the wght axis default: Mozaic GEO's fvar defaults to 100, so any
 * element the cascade leaves unweighted renders Thin. theme.json sets
 * styles.typography.fontWeight to the brand regular (425) on the root, which
 * covers this. Do NOT reach for font-variation-settings to enforce it — that
 * property is inherited and outranks font-weight, so setting it on body would
 * pin every heading and button to the body weight too.
 */
