/*
Theme Name: Matsu Bonsai
Theme URI: https://matsubonsai.com
Author: John Callaway
Description: Matsu Bonsai's theme. A child of Twenty Twenty-Five built around the Matsu Bonsai logo.
Template: twentytwentyfive
Version: 0.1.0
Requires at least: 6.7
Requires PHP: 8.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: matsubonsai
*/

/* Most styling lives in theme.json. This file holds what theme.json can't express. */

/* Eyebrow labels: small uppercase kicker above headings. */
.is-style-eyebrow {
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
}

/* Cards in query loops: keep image, meta and title on one rhythm. */
.matsu-card .wp-block-post-featured-image img {
	aspect-ratio: 3 / 2;
	object-fit: cover;
	border-radius: 3px;
}

.matsu-card .wp-block-post-terms,
.matsu-card .wp-block-post-date {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.matsu-card .wp-block-post-terms a {
	color: var(--wp--preset--color--blue);
	text-decoration: none;
}

.matsu-card .wp-block-post-title a {
	text-decoration: none;
}

/* Long URLs (article sources) wrap instead of pushing past a phone screen. */
.wp-block-post-content a {
	overflow-wrap: anywhere;
}

/* Article drop cap on the first paragraph of a post. */
.single-post .wp-block-post-content > p:first-of-type::first-letter {
	float: left;
	font-family: var(--wp--preset--font-family--newsreader);
	font-size: 5em;
	font-weight: 300;
	line-height: 0.82;
	padding: 0.08em 0.12em 0 0;
	color: var(--wp--preset--color--green);
}

/* Timeline: vertical rule with a ring per milestone. */
.matsu-timeline {
	list-style: none;
	margin: 0;
	padding: 0 0 0 28px;
	border-left: 2px solid var(--wp--preset--color--line);
}

.matsu-timeline li {
	position: relative;
	margin-bottom: 32px;
}

.matsu-timeline li::before {
	content: "";
	position: absolute;
	left: -36px;
	top: 10px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--wp--preset--color--paper);
	border: 3px solid var(--wp--preset--color--green);
}

.matsu-timeline strong {
	display: block;
	font-family: var(--wp--preset--font-family--newsreader);
	font-size: 30px;
	font-weight: 400;
	line-height: 1.1;
	color: var(--wp--preset--color--green);
}

/* About page: fact rail and the three practices (content/pages/about-redesign.html). */
.matsu-facts {
	border-block: 1px solid var(--wp--preset--color--line);
}

.matsu-facts .wp-block-columns {
	gap: 0;
}

.matsu-facts .wp-block-column {
	padding: 26px 24px 24px;
}

.matsu-facts .wp-block-column p {
	margin: 0;
}

.matsu-facts .wp-block-column p + p {
	margin-top: 10px;
}

.matsu-fact__num {
	font-weight: 300;
	line-height: 1;
	font-variant-numeric: lining-nums;
}

@media (min-width: 782px) {
	.matsu-facts .wp-block-column:first-child {
		padding-left: 0;
	}

	.matsu-facts .wp-block-column + .wp-block-column {
		border-left: 1px solid var(--wp--preset--color--line);
	}
}

@media (max-width: 781px) {
	.matsu-facts .wp-block-column {
		padding-inline: 0;
	}

	.matsu-facts .wp-block-column + .wp-block-column {
		border-top: 1px solid var(--wp--preset--color--line);
	}
}

.matsu-practices > .wp-block-column {
	border-top: 2px solid var(--wp--preset--color--ink);
	padding-top: 20px;
}

.matsu-practices a,
.matsu-links a {
	font-weight: 600;
	text-decoration: none;
}

/* Article hero: keep the title and labels readable over light photos. */
.matsu-page-hero .wp-block-post-title,
.matsu-post-hero .wp-block-post-title,
.matsu-post-hero .wp-block-post-terms,
.matsu-post-hero .wp-block-post-author-name,
.matsu-post-hero .wp-block-post-date {
	text-shadow: 0 1px 14px rgba(0, 0, 0, 0.45);
}

/* Photo heroes: tall enough to show the photo, never taller than a laptop screen. */
.wp-block-cover.matsu-post-hero {
	min-height: min(62vh, 620px) !important;
}

.wp-block-cover.matsu-page-hero {
	min-height: min(52vh, 520px) !important;
}

/* Phone menu overlay: left-aligned list like the old Neve menu, Community collapsible (assets/js/menu.js). */
.wp-block-navigation__responsive-container.is-menu-open {
	padding: 20px 24px 32px;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	align-items: stretch !important;
	padding-top: 48px;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
	align-items: stretch !important;
	justify-content: flex-start !important;
	gap: 0 !important;
	width: 100%;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
	display: flex;
	flex-direction: row !important;
	flex-wrap: wrap;
	align-items: center !important;
	justify-content: space-between !important;
	width: 100%;
	border-bottom: 1px solid var(--wp--preset--color--line);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item__content {
	flex: 1 1 auto;
	text-align: left;
	padding: 16px 0 !important;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 21px;
	font-weight: 600;
	line-height: 1.2;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container {
	flex-basis: 100%;
	align-items: flex-start !important;
	gap: 0 !important;
	padding: 0 0 10px 18px !important;
	border: 0 !important;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item {
	border: 0;
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__submenu-container .wp-block-navigation-item__content {
	padding: 10px 0 !important;
	font-size: 18px;
	font-weight: 500;
	color: var(--wp--preset--color--muted);
}

.matsu-sub-toggle {
	display: none;
}

.matsu-subs-js.is-menu-open .matsu-sub-toggle {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin-right: -10px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}

.matsu-subs-js.is-menu-open .matsu-sub-open > .matsu-sub-toggle svg {
	transform: rotate(180deg);
}

.matsu-subs-js.is-menu-open .wp-block-navigation-submenu:not(.matsu-sub-open) > .wp-block-navigation__submenu-container {
	display: none !important;
}

/* Yoast breadcrumbs in the photo heroes. */
.matsu-crumbs {
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 13px;
	color: var(--wp--preset--color--on-dark-muted);
	text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45);
}

.matsu-crumbs a {
	color: var(--wp--preset--color--on-dark);
	text-decoration: none;
}

.matsu-crumbs a:hover,
.matsu-crumbs a:focus-visible {
	text-decoration: underline;
}

/* Page numbers under the Articles, category, tag and search grids: buttons, like the old site. */
.wp-block-query-pagination {
	gap: 8px;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 15px;
}

.wp-block-query-pagination-numbers {
	display: flex;
	gap: 8px;
}

.wp-block-query-pagination .page-numbers,
.wp-block-query-pagination-previous,
.wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 3px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.wp-block-query-pagination a.page-numbers:hover,
.wp-block-query-pagination-previous:hover,
.wp-block-query-pagination-next:hover {
	border-color: var(--wp--preset--color--green);
	color: var(--wp--preset--color--green);
}

.wp-block-query-pagination .page-numbers.current {
	border-color: var(--wp--preset--color--green);
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
}

.wp-block-query-pagination .page-numbers.dots {
	border: 0;
	background: transparent;
}

/* Breadcrumbs on a light background (search results). */
.matsu-crumbs--light {
	color: var(--wp--preset--color--subtle);
	text-shadow: none;
}

.matsu-crumbs--light a {
	color: var(--wp--preset--color--green-deep);
}

/* Article sidebar (parts/sidebar.html): search, categories, books, tags. */
.matsu-sidebar {
	display: grid;
	gap: 14px;
	align-content: start;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 15px;
}

.matsu-sidebar .matsu-sidebar__title {
	margin: 26px 0 0;
	font-size: 24px;
	font-weight: 400;
}

.matsu-sidebar__search .wp-block-search__inside-wrapper {
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 3px;
	background: var(--wp--preset--color--white);
}

.matsu-sidebar__search .wp-block-search__input {
	border: 0;
	padding: 10px 12px;
	font-size: 15px;
}

.matsu-sidebar__search .wp-block-search__button {
	margin: 0;
	padding: 8px 12px;
	background: transparent;
	color: var(--wp--preset--color--green);
}

.matsu-sidebar__cats {
	list-style: none;
	margin: 0;
	padding: 0;
}

.matsu-sidebar__cats li {
	padding: 8px 0;
	border-top: 1px solid var(--wp--preset--color--line);
	color: var(--wp--preset--color--subtle);
}

.matsu-sidebar__cats a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.matsu-books {
	gap: 14px;
}

.matsu-books .wp-block-image {
	margin: 0;
}

.matsu-books img {
	width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	border-radius: 2px;
	box-shadow: 0 2px 8px rgba(22, 26, 22, 0.12);
}

.matsu-sidebar__tags a {
	display: inline-block;
	margin: 0 6px 8px 0;
	padding: 3px 11px;
	border-radius: 999px;
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--green-deep);
	line-height: 1.5;
	text-decoration: none;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.matsu-sidebar__tags a:hover,
.matsu-sidebar__tags a:focus-visible {
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
}

@media (min-width: 782px) {
	.matsu-sidebar {
		position: sticky;
		top: 24px;
	}
}

/* Under the article: tags, previous/next, comments. */
.matsu-post-tags {
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 14px;
	color: var(--wp--preset--color--subtle);
}

.matsu-post-tags a {
	display: inline-block;
	margin: 0 4px 6px 0;
	padding: 4px 12px;
	border-radius: 999px;
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s ease;
}

.matsu-post-tags a:hover,
.matsu-post-tags a:focus-visible {
	background: var(--wp--preset--color--blue);
	color: var(--wp--preset--color--white);
}

.matsu-post-tags .wp-block-post-terms__separator {
	display: none;
}

.matsu-post-nav {
	padding-top: 20px;
	border-top: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 15px;
}

.matsu-post-nav > * {
	flex: 1 1 240px;
}

.matsu-post-nav a {
	text-decoration: none;
	font-weight: 600;
}

.matsu-comments {
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 16px;
}

.matsu-comments input:not([type="submit"]):not([type="checkbox"]),
.matsu-comments textarea {
	box-sizing: border-box;
	width: 100%;
	padding: 10px 12px;
	border: 1px solid var(--wp--preset--color--footer-text);
	border-radius: 3px;
	font: inherit;
}

/* Contact form ([matsu_contact_form], inc/contact.php). */
.matsu-contact {
	display: grid;
	gap: 18px;
	padding: clamp(20px, 3vw, 36px);
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 16px;
}

.matsu-contact p,
.matsu-contact fieldset {
	margin: 0;
}

.matsu-contact__field {
	display: grid;
	gap: 7px;
	min-width: 0;
	border: 0;
	padding: 0;
}

.matsu-contact__field label,
.matsu-contact__field legend {
	font-size: 14px;
	font-weight: 600;
	padding: 0;
	margin-bottom: 7px;
}

.matsu-contact__field input,
.matsu-contact__field textarea {
	box-sizing: border-box;
	width: 100%;
	min-width: 0;
	padding: 12px 14px;
	border: 1px solid var(--wp--preset--color--footer-text);
	border-radius: 3px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font: inherit;
}

.matsu-contact__pair {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 18px;
}

.matsu-contact__topics {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.matsu-contact__topics input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.matsu-contact__topics label {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	margin: 0;
	padding: 8px 14px;
	border: 1px solid var(--wp--preset--color--footer-text);
	border-radius: 999px;
	background: var(--wp--preset--color--white);
	font-weight: 500;
	cursor: pointer;
}

.matsu-contact__topics input:checked + label {
	background: var(--wp--preset--color--green);
	border-color: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
}

.matsu-contact__topics input:focus-visible + label,
.matsu-contact__field input:focus-visible,
.matsu-contact__field textarea:focus-visible {
	outline: 2px solid var(--wp--preset--color--blue);
	outline-offset: 2px;
}

.matsu-contact__tip {
	padding: 12px 16px;
	border-radius: 3px;
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--muted);
	font-size: 14.5px;
}

.matsu-contact__send button {
	min-height: 48px;
	padding: 0 26px;
	border: 0;
	border-radius: 3px;
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.matsu-contact__send button:hover,
.matsu-contact__send button:focus-visible {
	background: var(--wp--preset--color--green-deep);
}

.matsu-contact__notice {
	padding: 12px 16px;
	border-radius: 3px;
	font-weight: 600;
}

.matsu-contact__notice.is-sent {
	background: var(--wp--preset--color--tint);
	color: var(--wp--preset--color--green-deep);
}

.matsu-contact__notice.is-error {
	background: #FBEAEA;
	color: #8A1F1F;
}

.matsu-contact__trap {
	position: absolute;
	left: -9999px;
}

/* Contact page side column and "before you write" notes. */
.matsu-contact-side h2,
.matsu-help h3 {
	font-weight: 400;
}

.matsu-contact-side ul {
	list-style: none;
	padding: 0;
}

.matsu-contact-side a,
.matsu-links a {
	font-weight: 600;
	text-decoration: none;
}

.matsu-help .wp-block-column {
	border-top: 2px solid var(--wp--preset--color--ink);
	padding-top: 18px;
}

/* YARPP's automatic related posts, restyled to match. */
.yarpp-related {
	margin-top: 64px;
	padding-top: 28px;
	border-top: 1px solid var(--wp--preset--color--line);
	font-family: var(--wp--preset--font-family--instrument-sans);
}

.yarpp-related h3 {
	font-family: var(--wp--preset--font-family--newsreader);
	font-weight: 300;
	font-size: 32px;
}

/*
 * Effects (assets/js/effects.js). Hidden states only apply under .matsu-fx,
 * which the script adds, so no content is hidden without JavaScript or when
 * reduced motion is requested.
 */
.matsu-caret {
	display: inline-block;
	width: 2px;
	height: 1em;
	margin-left: 2px;
	vertical-align: -0.12em;
	background: currentColor;
	animation: matsu-blink 0.9s steps(1) infinite;
}

@keyframes matsu-blink {
	50% { opacity: 0; }
}

.matsu-fx .is-style-flip-in > * {
	opacity: 0;
	transform: perspective(700px) rotateY(80deg);
	transform-origin: center;
	transition: opacity 0.5s ease, transform 0.8s cubic-bezier(0.2, 0.7, 0.2, 1);
	transition-delay: var(--matsu-delay, 0ms);
}

.matsu-fx .is-style-flip-in.is-in > * {
	opacity: 1;
	transform: none;
}

/* At a glance: the small fact box in articles. */
.matsu-glance {
	margin-block: 32px;
	padding: 18px 22px 8px;
	border: 1px solid var(--wp--preset--color--line);
	border-radius: 4px;
	background: var(--wp--preset--color--white);
	font-family: var(--wp--preset--font-family--instrument-sans);
	font-size: 15px;
	line-height: 1.5;
}

.matsu-glance .is-style-eyebrow {
	margin: 0 0 6px;
	font-size: 12px;
	letter-spacing: 0.14em;
}

.matsu-glance__table {
	margin: 0;
}

.matsu-glance__table table {
	border-collapse: collapse;
	width: 100%;
}

.matsu-glance__table td {
	border: 0;
	border-top: 1px solid var(--wp--preset--color--line);
	padding: 8px 0;
	vertical-align: top;
}

.matsu-glance__table td:first-child {
	width: 34%;
	padding-right: 16px;
	color: var(--wp--preset--color--subtle);
}

/* Interactive blocks inside article text keep the sans UI font. */
.wp-block-post-content .matsu-compare {
	margin-block: 40px;
}

/* Newsletter signup band: heading on the left, one-field Kit form on the right. */
.matsu-signup {
	gap: 28px;
}

.matsu-signup__text {
	flex: 1 1 380px;
}

.matsu-signup__text h2 {
	font-size: clamp(32px, 4vw, 40px);
}

.matsu-signup__form {
	flex: 1 1 420px;
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0;
}

.matsu-signup__form input[type="email"] {
	flex: 1 1 240px;
	min-height: 52px;
	padding: 0 18px;
	border: 1px solid var(--wp--preset--color--footer-text);
	border-radius: 3px;
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--ink);
	font: inherit;
	font-size: 16px;
}

.matsu-signup__form input[type="email"]:focus-visible {
	outline: 2px solid var(--wp--preset--color--green);
	outline-offset: 2px;
}

.matsu-signup__form button {
	min-height: 52px;
	padding: 0 28px;
	border: 0;
	border-radius: 3px;
	background: var(--wp--preset--color--green);
	color: var(--wp--preset--color--white);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.matsu-signup__form button:hover,
.matsu-signup__form button:focus-visible {
	background: var(--wp--preset--color--green-deep);
}

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

/* Footer top row: mission and recent articles, ruled off from the links row below. */
.matsu-footer-top {
	border-bottom: 1px solid rgba(238, 242, 234, 0.16);
}

.matsu-footer-recent {
	margin: 0;
	padding: 0;
	list-style: none;
}

.wp-block-latest-posts.matsu-footer-recent > li {
	margin: 0 !important;
	padding: 9px 0;
	border-top: 1px solid rgba(238, 242, 234, 0.1);
	line-height: 1.4;
}

.matsu-footer-recent a {
	text-decoration: none;
}

/* Footer logo sits on a paper chip so it reads on the dark footer. */
.matsu-logo-chip {
	background: var(--wp--preset--color--paper);
	padding: 10px 14px;
	border-radius: 3px;
}
