/**
 * Gutenberg / core block styles.
 * Keep specificity low so editor controls remain usable.
 *
 * Reusable Gutenberg wrappers:
 * .jrich-gutenberg — page canvas that allows wide/full alignments
 * .is-style-jrich-section — Group as a school section
 * .is-style-jrich-button / .is-style-jrich-button-secondary
 * .is-style-jrich-testimonial / .is-style-jrich-gallery
 */

/* -------------------------------------------------------------------------
   Wide / full alignment (classic hybrid layout)
   ------------------------------------------------------------------------- */

.jrich-gutenberg {
	width: 100%;
	max-width: none;
}

.jrich-gutenberg .jrich-article,
.jrich-gutenberg .jrich-article--page {
	max-width: none;
}

.jrich-gutenberg .entry-content > :where(:not(.alignwide):not(.alignfull):not(.alignleft):not(.alignright):not(.wp-block-separator)) {
	max-width: var(--jrich-width-content);
	margin-inline: auto;
	padding-inline: var(--jrich-gutter);
}

.jrich-gutenberg .entry-content > .alignwide {
	width: min(100% - (2 * var(--jrich-gutter)), var(--jrich-width-wide));
	max-width: var(--jrich-width-wide);
	margin-inline: auto;
}

.jrich-gutenberg .entry-content > .alignfull {
	width: 100%;
	max-width: none;
	margin-inline: 0;
}

.jrich-gutenberg .entry-content > .alignfull > :where(:not(.alignfull)) {
	max-width: var(--jrich-width-wide);
	margin-inline: auto;
	padding-inline: var(--jrich-gutter);
}

.entry-content > * + * {
	margin-top: var(--jrich-block-gap);
}

.entry-content > h2,
.entry-content > h3 {
	margin-top: var(--jrich-space-xl);
}

.entry-content > .wp-block-spacer,
.entry-content > .wp-block-separator,
.entry-content > * + .wp-block-spacer,
.entry-content > .wp-block-spacer + * {
	margin-top: 0;
}

.wp-block-spacer {
	clear: both;
}

/* -------------------------------------------------------------------------
   Group / columns / cover
   ------------------------------------------------------------------------- */

.wp-block-group.is-style-jrich-section,
.wp-block-group.jrich-section {
	padding-block: var(--jrich-section-space);
}

.wp-block-columns {
	gap: var(--jrich-space-lg);
}

.wp-block-cover:not([style*="min-height"]) {
	min-height: 22rem;
}

.wp-block-cover {
	border-radius: var(--jrich-radius-md);
}

.wp-block-cover.alignfull {
	border-radius: 0;
}

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */

.wp-block-buttons {
	display: flex;
	flex-wrap: wrap;
	gap: var(--jrich-space-sm);
}

.wp-block-button .wp-block-button__link:not(.has-background) {
	background-color: var(--jrich-color-green);
}

.wp-block-button .wp-block-button__link:not(.has-text-color) {
	color: var(--jrich-color-white);
}

.wp-block-button .wp-block-button__link {
	border-radius: var(--jrich-radius-sm);
	font-family: var(--jrich-font-ui);
	font-weight: var(--jrich-weight-semibold);
}

.wp-block-button .wp-block-button__link:hover,
.wp-block-button .wp-block-button__link:focus-visible {
	text-decoration: none;
}

.wp-block-button.is-style-outline .wp-block-button__link,
.wp-block-button.is-style-jrich-button-secondary .wp-block-button__link {
	background: transparent;
	border: 1px solid var(--jrich-color-green);
	color: var(--jrich-color-green-800);
}

.wp-block-button.is-style-outline .wp-block-button__link:hover,
.wp-block-button.is-style-outline .wp-block-button__link:focus-visible,
.wp-block-button.is-style-jrich-button-secondary .wp-block-button__link:hover,
.wp-block-button.is-style-jrich-button-secondary .wp-block-button__link:focus-visible {
	background: var(--jrich-color-green);
	color: var(--jrich-color-white);
}

.wp-block-button.is-style-jrich-button .wp-block-button__link {
	background-color: var(--jrich-color-green);
	color: var(--jrich-color-white);
}

/* -------------------------------------------------------------------------
   Quote / list / table
   ------------------------------------------------------------------------- */

.wp-block-quote.is-style-jrich-testimonial,
.wp-block-quote.is-style-plain {
	border-left-color: var(--jrich-color-gold);
	font-family: var(--jrich-font-display);
}

.wp-block-quote cite,
.wp-block-pullquote cite {
	font-family: var(--jrich-font-body);
	font-style: normal;
	font-size: var(--jrich-fs-sm);
	color: var(--jrich-color-muted);
}

.entry-content ul,
.entry-content ol,
.wp-block-list {
	padding-left: 1.2em;
}

.wp-block-table table {
	width: 100%;
	border-collapse: collapse;
}

.wp-block-table th,
.wp-block-table td {
	border-color: var(--jrich-color-line);
	padding: var(--jrich-space-xs) var(--jrich-space-sm);
}

.wp-block-table thead,
.wp-block-table .has-fixed-layout thead {
	background: var(--jrich-color-cream);
}

.wp-block-table figcaption {
	color: var(--jrich-color-muted);
	font-size: var(--jrich-fs-sm);
}

/* -------------------------------------------------------------------------
   Images / galleries
   ------------------------------------------------------------------------- */

.wp-block-gallery.is-style-jrich-gallery,
.wp-block-gallery {
	gap: var(--jrich-space-sm);
}

.wp-block-gallery .wp-block-image img,
.wp-block-gallery img {
	border-radius: var(--jrich-radius-md);
}

.wp-block-image img {
	height: auto;
	max-width: 100%;
	border-radius: var(--jrich-radius-md);
}

.wp-block-image.alignfull img,
.wp-block-cover img {
	border-radius: 0;
}

.wp-block-image figcaption,
.wp-block-embed figcaption,
.wp-block-video figcaption,
.wp-block-gallery figcaption {
	color: var(--jrich-color-muted);
	font-size: var(--jrich-fs-sm);
}

.wp-block-separator {
	border: 0;
	border-top: 1px solid var(--jrich-color-line);
	background: none;
}

.wp-block-pullquote {
	border: 0;
	padding: var(--jrich-space-lg) 0;
	font-family: var(--jrich-font-display);
	font-size: var(--jrich-fs-2xl);
	line-height: var(--jrich-lh-display);
	color: var(--jrich-color-green-900);
}

.wp-block-pullquote blockquote {
	border: 0;
	padding: 0;
	margin: 0;
}

.wp-block-post-title a,
.wp-block-query .wp-block-post-title a {
	text-decoration: none;
	color: inherit;
}

.wp-block-post-date {
	font-size: var(--jrich-fs-xs);
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: var(--jrich-color-gold-800);
}

.has-green-background-color {
	background-color: var(--jrich-color-green);
}

.has-green-color {
	color: var(--jrich-color-green);
}

.has-gold-color {
	color: var(--jrich-color-gold-800);
}

.has-blue-background-color {
	background-color: var(--jrich-color-blue);
}

.has-blue-color {
	color: var(--jrich-color-blue);
}

.has-cream-background-color {
	background-color: var(--jrich-color-cream);
}

.has-paper-background-color {
	background-color: var(--jrich-color-paper);
}

.has-ink-color {
	color: var(--jrich-color-ink);
}

.alignleft {
	margin: 0 var(--jrich-space-md) var(--jrich-space-md) 0;
}

.alignright {
	margin: 0 0 var(--jrich-space-md) var(--jrich-space-md);
}

.aligncenter {
	margin-block: var(--jrich-space-lg);
}
