/**
 * Kaizen by Elgwaro — front-end and editor styles.
 * Design tokens come from theme.json (var(--wp--preset--*)).
 */

/* ---------- Base ---------- */

.wp-site-blocks > * {
	margin-block-start: 0;
}

.kaizen-main > .alignfull:first-child,
.kaizen-main > .alignfull + .alignfull {
	margin-block-start: 0;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

a {
	text-decoration-thickness: 1px;
	text-underline-offset: 0.18em;
}

:where(a, button, input, select, textarea, summary):focus-visible {
	outline: 2px solid var(--wp--preset--color--accent);
	outline-offset: 2px;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute !important;
	width: 1px;
	word-wrap: normal !important;
}

::selection {
	background: var(--wp--preset--color--accent-3);
	color: var(--wp--preset--color--contrast);
}

/* ---------- Header & navigation ---------- */

.kaizen-header {
	border-bottom: 1px solid var(--wp--preset--color--border);
	background: var(--wp--preset--color--base);
}

.kaizen-header .wp-block-site-logo img {
	display: block;
}

.wp-block-navigation__responsive-container.is-menu-open {
	padding: var(--wp--preset--spacing--40);
}

.wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
	font-size: var(--wp--preset--font-size--x-large);
	font-family: var(--wp--preset--font-family--serif);
	gap: 1rem;
}

.wp-block-navigation__responsive-container-open:not(.always-shown),
.wp-block-navigation__responsive-container-close {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
}

/* ---------- Typography helpers ---------- */

.is-style-kaizen-eyebrow {
	font-family: var(--wp--preset--font-family--body) !important;
	font-size: 0.78rem !important;
	font-weight: 700 !important;
	letter-spacing: 0.12em;
	line-height: 1.4 !important;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
	margin-bottom: 0.5rem;
}

.kaizen-section-title {
	font-size: var(--wp--preset--font-size--x-large);
	margin-top: var(--wp--preset--spacing--60) !important;
	padding-top: var(--wp--preset--spacing--30);
	border-top: 1px solid var(--wp--preset--color--border);
}

.kaizen-lede {
	font-family: var(--wp--preset--font-family--serif);
	line-height: 1.35;
}

.kaizen-meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-2);
	row-gap: 0.25rem;
}

.kaizen-meta > * {
	margin: 0;
}

.kaizen-meta > * + *::before {
	content: "·";
	margin-right: 0.75rem;
	color: var(--wp--preset--color--contrast-2);
}

.kaizen-meta > .wp-block-paragraph:first-child + .wp-block-post-author-name::before,
.kaizen-meta > p:first-child + .wp-block-post-author-name::before {
	content: none;
}

/* Long-form reading */
.kaizen-prose {
	font-family: var(--wp--preset--font-family--serif);
	font-size: clamp(1.0625rem, 1rem + 0.35vw, 1.1875rem);
	line-height: 1.75;
}

.kaizen-prose > * + h2,
.kaizen-prose > * + h3 {
	margin-top: 1.6em;
}

.kaizen-prose :where(ul, ol) li + li {
	margin-top: 0.4em;
}

.kaizen-prose :where(sup a, .fn a) {
	text-decoration: none;
	color: var(--wp--preset--color--accent);
}

.kaizen-issue .wp-block-separator {
	margin-block: 2rem;
}

.kaizen-tags {
	margin-top: var(--wp--preset--spacing--40);
	text-transform: none !important;
	letter-spacing: 0 !important;
}

/* ---------- Buttons & lists ---------- */

.wp-block-button.is-style-kaizen-text .wp-block-button__link {
	background: transparent !important;
	color: inherit !important;
	padding: 0 !important;
	border-radius: 0;
	font-weight: 600;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
}

.wp-block-button.is-style-kaizen-text .wp-block-button__link:hover,
.wp-block-button.is-style-kaizen-text .wp-block-button__link:focus {
	color: var(--wp--preset--color--accent) !important;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background) {
	background: transparent;
	color: var(--wp--preset--color--contrast);
	border: 1.5px solid currentColor;
}

.wp-block-button.is-style-outline > .wp-block-button__link:not(.has-background):hover {
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
	border-color: var(--wp--preset--color--contrast);
}

ul.is-style-kaizen-plain,
ul.is-style-kaizen-check {
	list-style: none;
	padding-left: 0;
}

ul.is-style-kaizen-plain li + li,
ul.is-style-kaizen-check li + li {
	margin-top: 0.6rem;
}

ul.is-style-kaizen-check li {
	position: relative;
	padding-left: 1.9rem;
}

ul.is-style-kaizen-check li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.35em;
	width: 1.1rem;
	height: 1.1rem;
	border-radius: 50%;
	background: var(--wp--preset--color--accent)
		url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round' d='M4 8.5l2.5 2.5L12 5.5'/%3E%3C/svg%3E")
		center / 70% no-repeat;
}

.wp-block-read-more {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	text-decoration: none;
}

.wp-block-read-more:hover {
	text-decoration: underline;
}

/* ---------- Cards, images ---------- */

.wp-block-group.is-style-kaizen-card {
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 12px;
	padding: var(--wp--preset--spacing--40);
	height: 100%;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.wp-block-group.is-style-kaizen-card:hover {
	box-shadow: var(--wp--preset--shadow--soft);
	transform: translateY(-2px);
}

.wp-block-group.is-style-kaizen-card > * {
	margin: 0;
}

.wp-block-group.is-style-kaizen-card .wp-block-read-more {
	margin-top: auto;
}

.is-style-kaizen-shadow img,
.wp-block-post-featured-image.is-style-kaizen-shadow img {
	border-radius: 4px;
	box-shadow: 0 2px 4px rgba(22, 24, 29, 0.08), 0 18px 40px rgba(22, 24, 29, 0.18);
}

.kaizen-hero__cover img {
	transform: rotate(-2deg);
}

/* ---------- Query loop rows ---------- */

.wp-block-post-template.is-style-kaizen-rows {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--wp--preset--color--border);
}

.wp-block-post-template.is-style-kaizen-rows > li {
	margin: 0;
	padding: 1rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.kaizen-row {
	gap: 0.35rem 1.25rem;
}

.kaizen-row .wp-block-post-title,
.kaizen-row p {
	margin: 0;
	line-height: 1.35;
}

.kaizen-row--dated .wp-block-post-date {
	flex: 0 0 7.5rem;
	font-variant-numeric: tabular-nums;
}

.kaizen-entry > * {
	margin: 0;
}

/* ---------- Sign-up form ---------- */

.kaizen-subscribe {
	max-width: var(--wp--style--global--content-size, 700px);
}

.kaizen-subscribe__form {
	max-width: 36rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	margin: 0;
}

.kaizen-subscribe__input {
	flex: 1 1 13rem;
	min-width: 0;
	min-height: 3rem;
	padding: 0.7rem 1rem;
	font: inherit;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base);
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	box-shadow: inset 0 1px 2px rgba(22, 24, 29, 0.04);
}

.kaizen-subscribe__input:focus {
	border-color: var(--wp--preset--color--accent);
	outline: 2px solid var(--wp--preset--color--accent-3);
	outline-offset: 0;
}

.kaizen-subscribe.has-name-field .kaizen-subscribe__input:first-of-type {
	flex-basis: 9rem;
}

.kaizen-subscribe__button {
	min-height: 3rem;
	cursor: pointer;
	border: 0;
	white-space: nowrap;
}

.kaizen-subscribe__note {
	margin: 0.6rem 0 0;
	font-size: var(--wp--preset--font-size--x-small);
	opacity: 0.75;
}

.kaizen-subscribe__message {
	margin: 0 0 0.75rem;
	padding: 0.75rem 1rem;
	border-radius: 6px;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
}

.kaizen-subscribe__message.is-success {
	background: #e7f5ec;
	color: #14532d;
}

.kaizen-subscribe__message.is-error {
	background: #fdeceb;
	color: #8a1c13;
}

.kaizen-subscribe__hp {
	position: absolute !important;
	left: -9999px !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

/* Editor preview: let clicks select the block instead of focusing the form. */
.editor-styles-wrapper .kaizen-subscribe-editor form,
.block-editor-block-list__layout .kaizen-subscribe-editor form {
	pointer-events: none;
}

.kaizen-signup-card {
	border-radius: 14px;
	margin-top: var(--wp--preset--spacing--50) !important;
}

.kaizen-signup-card > * {
	margin-block-end: 0;
}

.kaizen-signup-card h3 {
	margin-top: 0.25rem;
}

/* ---------- Dark sections (CTA) ---------- */

.has-contrast-background-color :where(a:not(.wp-element-button)) {
	color: inherit;
}

.has-contrast-background-color .is-style-kaizen-eyebrow {
	color: #fdba8c;
}

.has-contrast-background-color .wp-element-button,
.has-contrast-background-color .wp-block-button__link {
	background-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--base);
}

.has-contrast-background-color .wp-element-button:hover,
.has-contrast-background-color .wp-block-button__link:hover {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.kaizen-cta ul.is-style-kaizen-check em {
	display: block;
	opacity: 0.8;
	margin-top: 0.2rem;
}

.kaizen-cta__panel {
	background: rgba(255, 255, 255, 0.06);
	border: 1px solid rgba(255, 255, 255, 0.12);
	border-radius: 14px;
	padding: var(--wp--preset--spacing--40);
}

.kaizen-cta__panel > * {
	margin-block-end: 0;
}

.kaizen-cta__panel h3 {
	margin-top: 0;
}

/* ---------- Newsletter archive ---------- */

.kaizen-issue-archive__year + .kaizen-issue-archive__year {
	margin-top: var(--wp--preset--spacing--50);
}

.kaizen-issue-archive__heading {
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0 0 0.75rem;
}

.kaizen-issue-archive__list {
	list-style: none;
	margin: 0;
	padding: 0;
	border-top: 1px solid var(--wp--preset--color--border);
}

.kaizen-issue-archive__item {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	gap: 1rem;
	align-items: baseline;
	padding: 0.8rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.kaizen-issue-archive__date {
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
	font-variant-numeric: tabular-nums;
}

.kaizen-issue-archive__link {
	font-weight: 500;
	text-decoration: none;
}

.kaizen-issue-archive__link:hover {
	text-decoration: underline;
}

/* ---------- Topic index ---------- */

.kaizen-topic-index {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 280px), 1fr));
	gap: var(--wp--preset--spacing--50) var(--wp--preset--spacing--50);
}

.kaizen-topic-index__title {
	font-size: var(--wp--preset--font-size--x-large);
	margin: 0 0 0.75rem;
}

.kaizen-topic-index__title a {
	text-decoration: none;
}

.kaizen-topic-index__description {
	color: var(--wp--preset--color--contrast-2);
	font-size: var(--wp--preset--font-size--small);
	margin: 0 0 0.75rem;
}

.kaizen-topic-index__list {
	list-style: none;
	margin: 0 0 0.85rem;
	padding: 0;
	border-top: 2px solid var(--wp--preset--color--contrast);
}

.kaizen-topic-index__list li {
	padding: 0.6rem 0;
	border-bottom: 1px solid var(--wp--preset--color--border);
	line-height: 1.4;
}

.kaizen-topic-index__list a {
	text-decoration: none;
}

.kaizen-topic-index__list a:hover {
	text-decoration: underline;
}

.kaizen-topic-index__more {
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--accent);
	text-decoration: none;
}

/* Topic pills (Categories block) */
.kaizen-topic-cloud,
.kaizen-topics .wp-block-categories {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	padding: 0;
	margin: 0;
}

.kaizen-topic-cloud li a,
.kaizen-topics .wp-block-categories li a {
	display: inline-block;
	padding: 0.35rem 0.9rem;
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 999px;
	text-decoration: none;
	background: var(--wp--preset--color--base);
}

.kaizen-topic-cloud li a:hover,
.kaizen-topics .wp-block-categories li a:hover {
	border-color: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--accent);
}

/* ---------- Events ---------- */

.kaizen-event {
	gap: var(--wp--preset--spacing--30);
}

.kaizen-event__date {
	flex: 0 0 5rem;
	width: 5rem;
	height: 5rem;
	text-align: center;
	border: 1.5px solid var(--wp--preset--color--accent);
	border-radius: 12px;
	align-items: center;
}

.kaizen-event__date p {
	margin: 0;
	line-height: 1.1;
}

.kaizen-event__day {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.75rem;
	font-weight: 700;
}

.kaizen-event__month {
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--wp--preset--color--accent);
}

.kaizen-event__body {
	flex: 1 1 auto;
	min-width: 0;
}

.kaizen-event__body > * {
	margin: 0;
}

.kaizen-event__more {
	flex: 0 0 auto;
}

.kaizen-meta__date {
	font-weight: 600;
	color: var(--wp--preset--color--contrast);
}

/* ---------- Books ---------- */

.kaizen-book-card > * {
	margin: 0;
}

.kaizen-book-card .wp-block-post-featured-image {
	margin-bottom: 0.75rem;
}

.kaizen-book-card .wp-block-post-featured-image img,
.wp-block-post-featured-image.is-style-kaizen-shadow img {
	object-fit: cover;
}

.kaizen-subtitle {
	font-family: var(--wp--preset--font-family--serif);
	font-style: italic;
	margin-top: 0;
}

/* ---------- Author box & comments ---------- */

.kaizen-author-box {
	gap: var(--wp--preset--spacing--30);
	margin-top: var(--wp--preset--spacing--50) !important;
}

.kaizen-author-box .wp-block-avatar {
	flex: 0 0 auto;
}

.kaizen-author-box p,
.kaizen-author-box .wp-block-post-author-biography {
	margin: 0;
}

.kaizen-comments {
	margin-top: var(--wp--preset--spacing--60);
}

.kaizen-comment {
	gap: 1rem;
	margin-bottom: var(--wp--preset--spacing--30);
}

.kaizen-comment .wp-block-comment-content p:first-child {
	margin-top: 0.25rem;
}

.wp-block-post-comments-form input:not([type="submit"]):not([type="checkbox"]),
.wp-block-post-comments-form textarea {
	border: 1px solid var(--wp--preset--color--border);
	border-radius: 6px;
	padding: 0.7rem 1rem;
	font: inherit;
}

/* ---------- Stats, testimonials, FAQ ---------- */

.kaizen-stats {
	margin-block: var(--wp--preset--spacing--50) !important;
	padding-block: var(--wp--preset--spacing--40);
	border-top: 1px solid var(--wp--preset--color--border);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.kaizen-stats p {
	margin: 0;
}

.kaizen-stat__number {
	font-family: var(--wp--preset--font-family--serif);
	font-size: var(--wp--preset--font-size--xx-large);
	font-weight: 700;
	line-height: 1.1;
	color: var(--wp--preset--color--accent);
}

.kaizen-stat__label {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--contrast-2);
}

.kaizen-testimonials .wp-block-quote {
	border-left: 0;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--base-2);
	border-radius: 14px;
	margin: 0;
	height: 100%;
}

.kaizen-faq .wp-block-details {
	border-bottom: 1px solid var(--wp--preset--color--border);
	padding: 1rem 0;
}

.kaizen-faq .wp-block-details summary {
	font-weight: 600;
	cursor: pointer;
}

/* ---------- Footer ---------- */

.kaizen-footer .wp-block-site-title {
	margin-bottom: 0.5rem;
}

.kaizen-footer .wp-block-separator {
	margin-block: var(--wp--preset--spacing--40);
}

.kaizen-footer .wp-block-group.alignwide > p {
	margin: 0;
}

.kaizen-credit a {
	color: inherit;
	font-weight: 600;
}

/* ---------- Responsive ---------- */

@media (max-width: 781px) {
	.wp-block-post-template.is-layout-grid.columns-4 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.kaizen-event {
		flex-wrap: wrap !important;
	}

	.kaizen-event__more {
		flex-basis: 100%;
		box-sizing: border-box;
	}
}

@media (max-width: 600px) {
	.kaizen-row--dated {
		flex-wrap: wrap !important;
	}

	.kaizen-row--dated .wp-block-post-date {
		flex-basis: 100%;
	}

	.kaizen-issue-archive__item {
		grid-template-columns: 1fr;
		gap: 0.15rem;
	}

	.kaizen-hero__cover img {
		max-width: 240px;
		height: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wp-block-group.is-style-kaizen-card {
		transition: none;
	}

	.wp-block-group.is-style-kaizen-card:hover {
		transform: none;
	}
}
