/*
Theme Name: The Jews and Japanese
Theme URI: https://jewsandjapanese.com
Author: The Jews and Japanese
Author URI: https://jewsandjapanese.com
Description: Block theme for The Jews and Japanese (ユダヤ人と日本人). Washi paper, indigo kagome, vermilion sun; bilingual English and Japanese type; brand patterns for title panels, section dividers, kagome-and-sun banners, bilingual columns, quotes and key figures. Works with the jij-core plugin (talks, people, members, the Next talk and Featured person blocks).
Requires at least: 6.5
Tested up to: 6.8
Requires PHP: 7.4
Version: 1.3.1
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: jewsandjapanese
Tags: block-patterns, full-site-editing, block-styles, custom-colors, editor-style, style-variations, wide-blocks, blog, education
*/

/*
 * Every colour, radius and size here is a design-system token, read from the
 * presets theme.json publishes (design system: "The Jews and Japanese").
 * Change a value in theme.json (and the design system), never here.
 */

/* ---------- Kagome fields (Group block styles) ---------- */
.is-style-kagome-indigo {
	background-color: var(--wp--preset--color--ai);
	background-image: url(assets/images/kagome-indigo.svg);
	background-repeat: repeat;
	background-size: var(--wp--custom--kagome--width) var(--wp--custom--kagome--height);
	color: var(--wp--preset--color--on-ai);
}
.is-style-kagome-light {
	background-color: var(--wp--preset--color--ai-tint);
	background-image: url(assets/images/kagome-light.svg);
	background-repeat: repeat;
	background-size: var(--wp--custom--kagome--width) var(--wp--custom--kagome--height);
	color: var(--wp--preset--color--sumi);
}
.is-style-kagome-paper {
	background-color: var(--wp--preset--color--washi);
	background-image: url(assets/images/kagome-paper.svg);
	background-repeat: repeat;
	background-size: var(--wp--custom--kagome--width) var(--wp--custom--kagome--height);
}
/* A paper plate that keeps words legible over the pattern */
.is-style-paper-plate {
	background-color: var(--wp--preset--color--washi-raised);
	color: var(--wp--preset--color--sumi);
	border-radius: var(--wp--custom--radius--sm);
}

/* ---------- Gold band: the separator between sections ---------- */
/* Specific enough to beat core's .wp-block-separator:not(.is-style-wide):not(.is-style-dots) { width: 100px }. */
hr.wp-block-separator.is-style-kin-band:not(.is-style-wide):not(.is-style-dots) {
	display: block;
	width: 100% !important;
	max-width: none !important;
	height: var(--wp--preset--spacing--6);
	margin: 0 !important;
	border: 0;
	background-color: var(--wp--preset--color--kin);
	color: var(--wp--preset--color--kin);
	opacity: 1;
}
/* Edge to edge even inside padded content (pages): the band is "full width" and runs under the side padding. */
hr.wp-block-separator.is-style-kin-band.alignfull:not(.is-style-wide):not(.is-style-dots) { width: auto !important; }
.has-global-padding > hr.wp-block-separator.is-style-kin-band.alignfull:not(.is-style-wide):not(.is-style-dots) {
	margin-left: calc(var(--wp--style--root--padding-left) * -1) !important;
	margin-right: calc(var(--wp--style--root--padding-right) * -1) !important;
}

/* ---------- The sun ---------- */
.wp-block-image.jj-sun img { border-radius: var(--wp--custom--radius--disc); }

/* Title panel: the sun straddles the edge between paper and kagome */
.jj-title-panel { overflow: hidden; }
.jj-title-panel > .wp-block-column:last-child { position: relative; }
.wp-block-image.jj-sun-straddle {
	margin-left: calc(-1 * var(--jj-sun, 220px) / 2) !important;
	margin-top: clamp(32px, 7vw, 88px) !important;
	width: var(--jj-sun, 220px);
}
.wp-block-image.jj-sun-straddle img { width: 100%; height: auto; }
@media (max-width: 781px) {
	.jj-title-panel > .wp-block-column:last-child { min-height: 200px !important; }
	.wp-block-image.jj-sun-straddle {
		margin-left: auto !important;
		margin-right: auto !important;
		margin-top: 40px !important;
		--jj-sun: 140px;
	}
}

/* ---------- Footer signature ---------- */
.jj-signature { gap: var(--wp--preset--spacing--3); }
.jj-signature p { margin: 0; line-height: 1.35; text-align: right; }
.jj-signature .wp-block-image { margin: 0; flex-shrink: 0; }

/* ---------- Header ---------- */
.jj-brand { gap: var(--wp--preset--spacing--3); }
.jj-brand .wp-block-site-title { margin: 0; }
.jj-brand p.jj-brand-ja { margin: 0; }

/* ---------- Details ---------- */
/* Keyboard focus: 2px tekhelet ring with a 2px washi gap. */
:where(.wp-site-blocks) :focus-visible {
	outline: 2px solid var(--wp--preset--color--tekhelet);
	outline-offset: 2px;
	box-shadow: 0 0 0 2px var(--wp--preset--color--washi);
}
.wp-block-button.is-style-outline > .wp-block-button__link {
	border: 1.5px solid currentColor;
	background: transparent;
	color: var(--wp--preset--color--ai);
}
.is-style-kagome-indigo .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--on-ai); }
.jj-card {
	background: var(--wp--preset--color--washi-raised);
	border: 1px solid var(--wp--preset--color--hairline);
	border-radius: var(--wp--custom--radius--sm);
}
.jj-figure-number { font-variant-numeric: lining-nums; }
[lang="he"], .jj-hebrew { direction: rtl; unicode-bidi: isolate; }
:lang(ja) { line-height: 1.8; }
/* Hebrew accent: one word or phrase at a time, right to left */
.jj-hebrew-accent { font-family: var(--wp--preset--font-family--hebrew); font-size: var(--wp--preset--font-size--hebrew-accent); line-height: 1.2; }
.jj-sprinkle { font-size: var(--wp--preset--font-size--lead); }

/* Design page */
.jj-pattern-sample { min-height: 160px; border: 1px solid var(--wp--preset--color--hairline); border-radius: var(--wp--custom--radius--sm); margin-bottom: var(--wp--preset--spacing--3); }
.jj-swatches { display: grid; grid-template-columns: repeat(auto-fill, minmax(9em, 1fr)); gap: var(--wp--preset--spacing--6); margin-top: var(--wp--preset--spacing--10); font-size: var(--wp--preset--font-size--label); line-height: 20px; color: var(--wp--preset--color--sumi-muted); }
.jj-swatch strong { color: var(--wp--preset--color--sumi); font-weight: 500; }
.jj-swatch-chip { display: block; height: 72px; margin-bottom: var(--wp--preset--spacing--2); border: 1px solid var(--wp--preset--color--hairline); border-radius: var(--wp--custom--radius--sm); }
.jj-proportion { display: flex; height: var(--wp--preset--spacing--6); margin-top: var(--wp--preset--spacing--10); border: 1px solid var(--wp--preset--color--hairline); border-radius: var(--wp--custom--radius--sm); overflow: hidden; }
.jj-proportion span { display: block; flex-basis: 0; }
.jj-proportion-caption { margin-top: var(--wp--preset--spacing--2); font-size: var(--wp--preset--font-size--caption); color: var(--wp--preset--color--sumi-muted); }
.jj-type-samples > p { margin-top: 0; margin-bottom: 0; }
.jj-type-samples > .jj-type-label { margin: var(--wp--preset--spacing--2) 0 var(--wp--preset--spacing--10); padding-top: var(--wp--preset--spacing--2); border-top: 1px solid var(--wp--preset--color--hairline); color: var(--wp--preset--color--sumi-muted); }
.jj-design-mark img { border-radius: var(--wp--custom--radius--disc); }

/* Closing card: thanks in Hebrew and Japanese */
.jj-thanks .jj-thanks-he { font-family: var(--wp--preset--font-family--hebrew); font-size: var(--wp--preset--font-size--hebrew-accent); }
.jj-thanks .jj-thanks-ja { font-family: var(--wp--preset--font-family--display-ja); font-size: var(--wp--preset--font-size--heading-ja); }
.wp-block-image.is-style-sun img { border-radius: var(--wp--custom--radius--disc); }

/* Panel heights and the kagome-and-sun banner */
.jj-title-panel > .wp-block-column:last-child { min-height: clamp(360px, 44vw, 600px); }
.jj-section-panel > .wp-block-column:last-child { min-height: clamp(260px, 30vw, 400px); }
.jj-section-panel .wp-block-image.jj-sun-straddle { --jj-sun: 160px; }
.jj-kagome-sun { min-height: clamp(320px, 45vw, 560px); }
.jj-kagome-sun .wp-block-image.jj-sun { width: clamp(170px, 26vw, 340px); margin: 0 auto; }
.jj-kagome-sun .wp-block-image.jj-sun img { width: 100%; height: auto; }

/* Quotes: a tinted block, no side rule */
.wp-block-quote { border-left: 0; }
.wp-block-quote cite {
	display: block;
	margin-top: var(--wp--preset--spacing--3);
	font-family: var(--wp--preset--font-family--sans);
	font-size: var(--wp--preset--font-size--label);
	font-style: normal;
	color: var(--wp--preset--color--sumi-muted);
}
/* Outline buttons sitting on a paper plate keep indigo text, even inside a kagome field */
.is-style-paper-plate .wp-block-button.is-style-outline > .wp-block-button__link { color: var(--wp--preset--color--ai); }
