@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600&family=Newsreader:ital,opsz,wght@0,6..72,400;0,6..72,500;1,6..72,400&display=swap');

/* Shared defaults for editable theme content and the Gutenberg canvas.
   Block-level inline styles intentionally win over these :where() rules. */
:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) {
	--ag-content-width: 740px;
	--ag-wide-width: 1120px;
	--ag-block-gap: 18px;
	color: #573a30;
	font-family: "Manrope", Arial, sans-serif;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(h1, h2, h3, h4, h5, h6, .wp-block-quote p) {
	font-family: "Newsreader", Georgia, serif;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(p, li, figcaption) {
	font-family: "Manrope", Arial, sans-serif;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(button, input, select, textarea) {
	font-family: "Manrope", Arial, sans-serif;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(.wp-block-image, .wp-block-gallery figure) {
	overflow: hidden;
	border-radius: 18px;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(.wp-block-image img, .wp-block-gallery figure img) {
	max-width: 100%;
	height: auto;
	border-radius: inherit;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(.wp-block-button__link) {
	padding: 12px 26px;
	border-radius: 999px;
	background: #573a30;
	color: #f5f0e9;
	font-family: "Manrope", Arial, sans-serif;
	font-size: 15px;
	font-weight: 600;
	text-decoration: none;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(.is-style-outline .wp-block-button__link) {
	border: 1px solid #8a6658;
	background: transparent;
	color: #573a30;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(.wp-block-columns) {
	align-items: flex-start;
}

:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(.wp-block-column) {
	min-width: 0;
}

.editor-styles-wrapper {
	background: #e7e0d8;
}

.editor-styles-wrapper p {
	text-align: justify;
	text-justify: inter-word;
	hyphens: auto;
}

.editor-styles-wrapper .is-root-container > :where(p, h2, h3, blockquote) {
	width: min(100%, var(--ag-content-width));
	margin-right: auto;
	margin-left: auto;
}

.editor-styles-wrapper .is-root-container > p {
	margin-bottom: 18px;
	font-size: 18px;
	line-height: 1.7;
}

.editor-styles-wrapper .is-root-container > h2 { font-size: clamp(32px, 3vw, 38px); }
.editor-styles-wrapper .is-root-container > h3 { font-size: clamp(28px, 2.5vw, 32px); }

.page-content > :where(p, h2, h3, blockquote) {
	max-width: var(--ag-content-width);
	margin-right: auto;
	margin-left: auto;
}

.page-content > .alignwide {
	position: relative;
	left: 50%;
	width: min(var(--ag-wide-width), calc(100vw - 40px));
	max-width: none;
	transform: translateX(-50%);
}

.editor-styles-wrapper .is-root-container > :where(.wp-block-group, .wp-block-columns, .wp-block-image, .wp-block-gallery).alignwide {
	max-width: var(--ag-wide-width);
	margin-right: auto;
	margin-left: auto;
}

/* Archive and catalog introductions use the same class-based treatment in
   the editor as their existing frontend templates. */
.editor-styles-wrapper .catalog-page__intro,
.editor-styles-wrapper .journal-archive__intro {
	width: min(100%, 1120px);
	margin: 0 auto 30px;
	padding: clamp(22px, 2.8vw, 36px);
	border: 1px solid rgba(87, 58, 48, 0.12);
	background: rgba(245, 240, 233, 0.74);
}

.editor-styles-wrapper .catalog-page__intro { border-radius: 12px; }
.editor-styles-wrapper .catalog-page__intro--olive { background: #d4d4c5; }
.editor-styles-wrapper .catalog-page__intro--blush { background: #dfccc4; }
.editor-styles-wrapper .journal-archive__intro { border-radius: 22px; }

.editor-styles-wrapper .catalog-page__intro h1,
.editor-styles-wrapper .journal-archive__intro h1 {
	max-width: 760px;
	margin: 8px 0 16px;
	font-family: "Newsreader", Georgia, serif;
	font-size: clamp(30px, 3.25vw, 40px);
	font-weight: 400;
	line-height: 1.04;
}

.editor-styles-wrapper .journal-archive__intro h1 {
	font-size: clamp(36px, 3.8vw, 48px);
}

.editor-styles-wrapper .catalog-page__intro p:last-child,
.editor-styles-wrapper .journal-archive__intro p:last-child {
	max-width: 620px;
	margin: 0;
	font-size: 15px;
	line-height: 1.7;
}

.editor-styles-wrapper .analysis-process {
	width: min(100%, 1120px);
	margin: 0 auto 22px;
	padding: clamp(18px, 2vw, 24px);
	border: 1px solid rgba(87, 58, 48, 0.12);
	border-top: 0;
	border-radius: 0 0 18px 18px;
	background: rgba(245, 240, 233, 0.74);
}

.editor-styles-wrapper .catalog-page__intro:has(+ .analysis-process) {
	margin-bottom: 0;
	border-bottom: 0;
	border-radius: 18px 18px 0 0;
}

.editor-styles-wrapper .catalog-page__intro:has(+ .analysis-process) h1,
.editor-styles-wrapper .catalog-page__intro:has(+ .analysis-process) p:last-child { max-width: none; }

.editor-styles-wrapper .analysis-process > h2 { max-width: 800px; margin: 5px 0 8px; font-family: "Newsreader", Georgia, serif; font-size: clamp(25px, 2.5vw, 29px); font-weight: 500; line-height: 1.15; }
.editor-styles-wrapper .analysis-process > .analysis-process__intro { max-width: 760px; margin: 0 0 14px; font-size: 14px; line-height: 1.55; }
.editor-styles-wrapper .analysis-process__item { margin: 0 0 6px; border: 1px solid rgba(87, 58, 48, 0.16); border-radius: 14px; background: rgba(255, 255, 255, 0.16); }
.editor-styles-wrapper .analysis-process__item[open] { background: rgba(255, 255, 255, 0.34); border-color: rgba(87, 58, 48, 0.24); }
.editor-styles-wrapper .analysis-process__item > summary { display: grid; grid-template-columns: 18px minmax(0, 1fr) 10px; align-items: center; gap: 10px; padding: 10px 14px; list-style: none; cursor: pointer; font-family: "Newsreader", Georgia, serif; font-size: 16px; font-weight: 500; line-height: 1.25; }
.editor-styles-wrapper .analysis-process__item > summary::-webkit-details-marker { display: none; }
.editor-styles-wrapper .analysis-process__item > summary::before { content: '✷'; color: #8a6658; font-family: "Newsreader", Georgia, serif; font-size: 15px; font-weight: 400; line-height: 1; }
.editor-styles-wrapper .analysis-process__item > summary::after { content: ''; width: 8px; height: 8px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: translateY(-2px) rotate(45deg); }
.editor-styles-wrapper .analysis-process__item[open] > summary::after { transform: translateY(2px) rotate(225deg); }
.editor-styles-wrapper .analysis-process__item > p { max-width: 800px; margin: 0 14px 12px 42px; font-size: 14px; line-height: 1.6; }
.editor-styles-wrapper .analysis-process__item > p:last-child { margin-bottom: 14px; }

@media (max-width: 639px) {
	.editor-styles-wrapper .analysis-process > h2 { font-size: 25px; }
	.editor-styles-wrapper .analysis-process__item > summary { grid-template-columns: 17px minmax(0, 1fr) 9px; gap: 8px; padding: 10px 12px; font-size: 16px; }
	.editor-styles-wrapper .analysis-process__item > p { margin-right: 12px; margin-left: 37px; }
}

/* Private homepage section pages preview the same two-column compositions. */
.editor-styles-wrapper .home-about__inner,
.editor-styles-wrapper .matrix-teaser {
	display: grid;
	grid-template-columns: minmax(0, 1.55fr) minmax(290px, 0.9fr);
	gap: 36px;
	align-items: center;
	width: min(100%, 1120px);
	margin: 0 auto;
}

.editor-styles-wrapper .home-about__inner > .block-editor-inner-blocks,
.editor-styles-wrapper .home-about__inner > .block-editor-inner-blocks > .block-editor-block-list__layout,
.editor-styles-wrapper .matrix-teaser > .block-editor-inner-blocks,
.editor-styles-wrapper .matrix-teaser > .block-editor-inner-blocks > .block-editor-block-list__layout {
	display: contents;
}

.editor-styles-wrapper .home-about__portrait {
	width: min(100%, 430px);
	margin: 0 auto;
	aspect-ratio: 4 / 5;
	overflow: hidden;
	border-radius: 18px;
}

.editor-styles-wrapper .home-about__portrait img { width: 100%; height: 100%; object-fit: cover; }
.editor-styles-wrapper .home-about__content h2 { font-size: clamp(30px, 3vw, 36px); }
.editor-styles-wrapper .home-about__content p { font-size: 14px; line-height: 1.65; }
.editor-styles-wrapper .home-about__content .home-about__lead { font-size: 14px; }

.editor-styles-wrapper .matrix-teaser {
	grid-template-columns: minmax(0, 0.95fr) minmax(330px, 1.05fr);
	padding: 34px;
	background: #573a30;
	color: #f5f0e9;
}

.editor-styles-wrapper .matrix-teaser h2 { font-size: clamp(30px, 3vw, 36px); }
.editor-styles-wrapper .matrix-teaser__content > p:not(.section-kicker) { max-width: 540px; font-size: 13px; line-height: 1.75; }
.editor-styles-wrapper .matrix-teaser__content .button--light { display: inline-block; padding: 12px 26px; border-radius: 999px; background: #f5f0e9; color: #573a30; text-decoration: none; }
.editor-styles-wrapper .matrix-teaser__visual { width: min(100%, 680px); margin: 0 auto; border-radius: 0; }
.editor-styles-wrapper .matrix-teaser__visual img { width: 100%; height: auto; object-fit: contain; filter: brightness(1.12) contrast(1.08); }
.editor-styles-wrapper .matrix-teaser__visual { position: relative; }
.editor-styles-wrapper .matrix-teaser__visual:has(img[src*="matrix-teaser-chart-transparent.png"])::after {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background: url("../images/matrix-teaser-chart-transparent.png") center / 100% 100% no-repeat;
	filter: invert(1);
	mix-blend-mode: lighten;
	-webkit-mask: url("../images/matrix-teaser-numerals-mask.svg") center / 100% 100% no-repeat;
	mask: url("../images/matrix-teaser-numerals-mask.svg") center / 100% 100% no-repeat;
}

:where(.ag-pattern-section, .ag-pattern-wide-copy, .ag-pattern-two-images, .ag-pattern-editorial-gallery, .ag-pattern-cta, .ag-pattern-heading) {
	width: min(100%, 1120px);
	margin: 56px auto;
}

:where(.ag-pattern-wide-copy, .ag-pattern-heading) {
	max-width: 980px;
}

:where(.ag-pattern-section h2, .ag-pattern-wide-copy h2, .ag-pattern-cta h2, .ag-pattern-heading h2) {
	margin: 0 0 22px;
	font-size: clamp(36px, 3.2vw, 42px);
	font-weight: 400;
	line-height: 1.12;
}

:where(.ag-pattern-section p, .ag-pattern-wide-copy p, .ag-pattern-cta p, .ag-pattern-heading p) {
	margin: 0 0 18px;
	font-size: 18px;
	line-height: 1.65;
}

:where(.ag-pattern-split, .ag-pattern-photo-columns) {
	gap: var(--wp--style--block-gap, 36px);
	align-items: flex-start;
}

:where(.ag-pattern-section .wp-block-image, .ag-pattern-photo-columns .wp-block-image) {
	margin: 0;
}

:where(.ag-pattern-quote) {
	max-width: 780px;
	margin: 40px auto;
	padding: 22px 28px;
	border-left: 2px solid #a99488;
	background: #f5f0e9;
}

:where(.ag-pattern-quote p) {
	margin: 0;
	font-family: "Newsreader", Georgia, serif;
	font-size: clamp(24px, 2.2vw, 28px);
	font-style: italic;
	line-height: 1.35;
}

:where(.ag-pattern-editorial-gallery) {
	display: grid;
	grid-template-columns: 1.6fr 1fr;
	gap: var(--wp--style--block-gap, 16px);
}

.editor-styles-wrapper .ag-pattern-editorial-gallery > .block-editor-inner-blocks,
.editor-styles-wrapper .ag-pattern-editorial-gallery > .block-editor-inner-blocks > .block-editor-block-list__layout {
	display: contents;
}

:where(.ag-pattern-editorial-gallery > .wp-block-image:first-child) {
	grid-row: span 2;
}

.editor-styles-wrapper .ag-pattern-editorial-gallery > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-image:first-child {
	grid-row: span 2;
}

:where(.ag-pattern-editorial-gallery .wp-block-image) {
	width: 100%;
	min-height: 0;
	margin: 0;
}

:where(.ag-pattern-editorial-gallery .wp-block-image img) {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

:where(.ag-pattern-stat) {
	max-width: 260px;
	margin: 36px auto;
}

:where(.ag-pattern-stat .ag-pattern-stat__number) {
	margin: 0 0 8px;
	font-family: "Newsreader", Georgia, serif;
	font-size: clamp(64px, 6vw, 76px);
	line-height: 1;
}

:where(.ag-pattern-cta) {
	max-width: 850px;
	padding: 28px 32px;
	border-radius: 18px;
	background: #f5f0e9;
}

@media (max-width: 781px) {
	.editor-styles-wrapper .home-about__inner,
	.editor-styles-wrapper .matrix-teaser {
		grid-template-columns: minmax(0, 1fr);
		gap: 24px;
	}
	:where(.editor-styles-wrapper, .page-content, .about-page, .single-journal__content, .ag-editable) :where(.wp-block-columns:not(.is-not-stacked-on-mobile)) {
		flex-wrap: wrap;
	}
	:where(.ag-pattern-editorial-gallery) {
		grid-template-columns: 1fr 1fr;
	}
	:where(.ag-pattern-editorial-gallery > .wp-block-image:first-child) {
		grid-row: auto;
		grid-column: span 2;
	}
	.editor-styles-wrapper .ag-pattern-editorial-gallery > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-image:first-child {
		grid-row: auto;
		grid-column: span 2;
	}
}

@media (max-width: 639px) {
	:where(.ag-pattern-section, .ag-pattern-wide-copy, .ag-pattern-two-images, .ag-pattern-editorial-gallery, .ag-pattern-cta, .ag-pattern-heading) {
		margin-block: 44px;
	}
	:where(.ag-pattern-editorial-gallery) {
		grid-template-columns: 1fr;
	}
	:where(.ag-pattern-editorial-gallery > .wp-block-image:first-child) {
		grid-column: auto;
	}
	.editor-styles-wrapper .ag-pattern-editorial-gallery > .block-editor-inner-blocks > .block-editor-block-list__layout > .wp-block-image:first-child {
		grid-column: auto;
	}
	:where(.ag-pattern-section p, .ag-pattern-wide-copy p, .ag-pattern-cta p, .ag-pattern-heading p) {
		font-size: 16px;
	}
}
