/**
 * Saiberlab Journal — article layout.
 *
 * Type scale, colours and the inset panel are taken from the journal cards and
 * the page sections, so an article reads as part of the same site rather than
 * as a theme default.
 */

.slj-article {
	--slj-line: #e4dcd3;
	--slj-accent: #9a6c3c;
	--slj-ink: #15120f;
	--slj-body: #4a423a;
	--slj-muted: #8a837c;
	--slj-panel: #ffffff;
	--slj-soft: #faf7f4;

	/* The same inset frame the page sections sit in. */
	background: var(--slj-panel);
	border: 1px solid var(--slj-line);
	border-radius: 14px 14px 0 0;
	margin: 38px 38px 0;
	overflow: hidden;
}

/* Shared measure, so headline, body and footer all line up. It follows the
   site content column rather than a narrow reading strip, which is what left
   the panel looking mostly empty. */
.slj-hero__inner,
.slj-body__inner,
.slj-more__inner {
	margin: 0 auto;
	/* Elementor's boxed container is 1360px and the sections add 38px of
	   padding, so 1436 here puts the article text on exactly the same measure
	   as every other page. */
	max-width: 1436px;
	padding-left: 38px;
	padding-right: 38px;
}

/* Header ------------------------------------------------------------------- */

.slj-hero {
	padding: 52px 0 26px;
}

.slj-eyebrow {
	color: var(--slj-accent);
	font-family: Jost, sans-serif;
	font-size: 11px;
	font-weight: 400;
	letter-spacing: 2.4px;
	margin: 0 0 14px;
	text-transform: uppercase;
}

.slj-title {
	color: var(--slj-ink);
	font-family: "Playfair Display", serif;
	font-size: 44px;
	font-weight: 400;
	line-height: 1.18;
	margin: 0;
}

.slj-meta {
	color: var(--slj-muted);
	font-family: Jost, sans-serif;
	font-size: 14px;
	margin: 16px 0 0;
}

/* Lead image ----------------------------------------------------------------
   Held to the text measure and shown at its natural aspect ratio. The template
   sets a per-image max-width from the file's real pixel width, so a small
   source sits centred at true size instead of being stretched to fit. */

.slj-figure {
	margin: 0 auto;
	max-width: 1436px;
	padding: 0 38px;
}

.slj-figure__img {
	border-radius: 8px;
	display: block;
	/* Natural aspect ratio: a fixed band cropped the top and bottom off
	   images whose whole point is that they are read, not just decorative. */
	height: auto;
	margin: 0 auto;
	width: 100%;
}

/* Body --------------------------------------------------------------------- */

.slj-body {
	padding: 34px 0 52px;
}

.slj-body__inner {
	color: var(--slj-body);
	font-family: Jost, sans-serif;
	font-size: 18px;
	line-height: 1.75;
}

.slj-body__inner p {
	margin: 0 0 22px;
}

.slj-body__inner h2 {
	color: var(--slj-ink);
	font-family: "Playfair Display", serif;
	font-size: 27px;
	font-weight: 400;
	line-height: 1.3;
	margin: 44px 0 16px;
}

.slj-body__inner h3 {
	color: var(--slj-ink);
	font-family: "Playfair Display", serif;
	font-size: 21px;
	font-weight: 400;
	margin: 34px 0 12px;
}

.slj-body__inner ul,
.slj-body__inner ol {
	margin: 0 0 22px;
	padding-left: 22px;
}

.slj-body__inner li {
	margin-bottom: 9px;
}

.slj-body__inner a {
	color: var(--slj-accent);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.slj-body__inner strong {
	color: var(--slj-ink);
	font-weight: 500;
}

.slj-body__inner blockquote {
	border-left: 2px solid var(--slj-accent);
	font-size: 19px;
	margin: 30px 0;
	padding: 4px 0 4px 22px;
}

.slj-body__inner img {
	border-radius: 6px;
	height: auto;
	max-width: 100%;
}

/* Keep reading ------------------------------------------------------------- */

.slj-more {
	background: var(--slj-soft);
	border-top: 1px solid var(--slj-line);
	padding: 48px 0 54px;
}

.slj-more__inner {
	max-width: 1100px;
}

.slj-more__grid {
	display: grid;
	gap: 22px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	margin-top: 20px;
}

.slj-more__card {
	background: var(--slj-panel);
	border: 1px solid var(--slj-line);
	border-radius: 8px;
	color: inherit;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	text-decoration: none;
	transition: border-color .18s ease;
}

.slj-more__card:hover {
	border-color: var(--slj-accent);
}

.slj-more__media {
	aspect-ratio: 11 / 8;
	display: block;
	overflow: hidden;
}

.slj-more__media img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.slj-more__body {
	display: block;
	padding: 16px 20px 20px;
}

.slj-more__title {
	color: var(--slj-ink);
	display: block;
	font-family: "Playfair Display", serif;
	font-size: 18px;
	line-height: 1.3;
	margin-top: 4px;
}

.slj-more__meta {
	color: var(--slj-muted);
	display: block;
	font-family: Jost, sans-serif;
	font-size: 13px;
	margin-top: 8px;
}

/* Back --------------------------------------------------------------------- */

.slj-back {
	border-top: 1px solid var(--slj-line);
	padding: 26px 38px;
	text-align: center;
}

.slj-back__link {
	align-items: center;
	color: var(--slj-accent);
	display: inline-flex;
	font-family: Jost, sans-serif;
	font-size: 11px;
	gap: 8px;
	letter-spacing: 1.8px;
	text-decoration: none;
	text-transform: uppercase;
}

/* Responsive --------------------------------------------------------------- */

@media (max-width: 1024px) {
	.slj-article {
		margin: 11px 11px 0;
	}

	.slj-figure {
		padding: 0 26px;
	}

	.slj-title {
		font-size: 34px;
	}

	.slj-hero {
		padding: 44px 0 24px;
	}

	.slj-hero__inner,
	.slj-body__inner,
	.slj-more__inner {
		padding-left: 26px;
		padding-right: 26px;
	}

	.slj-more__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.slj-title {
		font-size: 28px;
	}

	.slj-figure {
		padding: 0 18px;
	}

	.slj-body {
		padding: 32px 0 44px;
	}

	.slj-body__inner {
		font-size: 16px;
	}

	.slj-body__inner h2 {
		font-size: 23px;
		margin-top: 34px;
	}

	.slj-hero__inner,
	.slj-body__inner,
	.slj-more__inner {
		padding-left: 18px;
		padding-right: 18px;
	}

	.slj-more__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Article listing -----------------------------------------------------------
   Values measured from the hand-built cards these replace, so the page keeps
   the layout it had. */

.slj-list {
	--slj-line: #e4dcd3;
	--slj-accent: #9a6c3c;
	--slj-ink: #15120f;
	--slj-body: #6e6862;
	--slj-muted: #8a837c;
}

.slj-list .slj-eyebrow {
	display: block;
	margin-bottom: 8px;
}

.slj-item {
	color: inherit;
	display: block;
	text-decoration: none;
}

.slj-item__title {
	color: var(--slj-ink);
	display: block;
	font-family: "Playfair Display", serif;
	font-size: 19px;
	font-weight: 400;
	line-height: 1.3;
}

.slj-item__excerpt {
	color: var(--slj-body);
	display: block;
	font-family: Jost, sans-serif;
	font-size: 14px;
	line-height: 1.7;
	margin-top: 10px;
}

.slj-item__meta {
	color: var(--slj-muted);
	display: block;
	font-family: Jost, sans-serif;
	font-size: 12.5px;
	margin-top: 14px;
}

/* Four-up cards ------------------------------------------------------------- */

.slj-list--grid {
	display: grid;
	gap: 22px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.slj-list--grid .slj-item {
	background: #fff;
	border: 1px solid var(--slj-line);
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transition: border-color .18s ease;
}

.slj-list--grid .slj-item:hover {
	border-color: var(--slj-accent);
}

.slj-list--grid .slj-item__media {
	aspect-ratio: 268 / 120;
	display: block;
	overflow: hidden;
}

.slj-list--grid .slj-item__media img {
	display: block;
	height: 100%;
	object-fit: cover;
	width: 100%;
}

.slj-list--grid .slj-item__body {
	display: block;
	flex-grow: 1;
	padding: 18px 20px 22px;
}

/* Stacked list -------------------------------------------------------------- */

.slj-list--stacked {
	display: flex;
	flex-direction: column;
	/* Matches the spacing the hand-built rows had between items. */
	gap: 20px;
}

.slj-list--stacked .slj-item {
	align-items: flex-start;
	border-top: 1px solid var(--slj-line);
	display: flex;
	gap: 20px;
	padding: 16px 0;
}

.slj-list--stacked .slj-item:last-child {
	border-bottom: 1px solid var(--slj-line);
}

.slj-list--stacked .slj-item__media {
	/* Fixed width, natural height. The old 89x54 box cropped roughly a fifth
	   off images that carry readable text, and was too small to read besides. */
	flex: 0 0 auto;
	height: auto;
	width: 160px;
}

.slj-list--stacked .slj-item__media img {
	border-radius: 4px;
	display: block;
	height: auto;
	object-fit: contain;
	width: 100%;
}

.slj-list--stacked .slj-item__body {
	display: block;
	min-width: 0;
}

.slj-list--stacked .slj-item__title {
	font-size: 18px;
}

.slj-list--stacked .slj-item__excerpt {
	margin-top: 6px;
}

.slj-list--stacked .slj-item__meta {
	margin-top: 8px;
}

@media (max-width: 1024px) {
	.slj-list--grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 767px) {
	.slj-list--grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.slj-list--stacked .slj-item {
		gap: 14px;
	}

	.slj-list--stacked .slj-item__media {
		width: 108px;
	}
}

/* Pager ---------------------------------------------------------------------
   Anchors rather than buttons, and every colour stated outright: the theme
   paints bare controls with the accent fill, which would turn these into pink
   pills the moment a selector went unqualified. */

.slj-pager {
	/* Sibling of .slj-list, not a child, so it cannot inherit its tokens. */
	--slj-line: #e4dcd3;
	--slj-accent: #9a6c3c;
	--slj-body: #6e6862;

	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	justify-content: center;
	margin-top: 34px;
}

.slj-pager a.slj-pager__link,
.slj-pager span.slj-pager__link {
	align-items: center;
	background: transparent;
	border: 1px solid var(--slj-line);
	border-radius: 6px;
	color: var(--slj-body);
	display: inline-flex;
	font-family: Jost, sans-serif;
	font-size: 13px;
	justify-content: center;
	letter-spacing: .4px;
	min-width: 38px;
	padding: 9px 14px;
	text-decoration: none;
	transition: border-color .18s ease, color .18s ease;
}

.slj-pager a.slj-pager__link:hover,
.slj-pager a.slj-pager__link:focus-visible {
	border-color: var(--slj-accent);
	color: var(--slj-accent);
}

.slj-pager span.slj-pager__link.is-current {
	background: var(--slj-accent);
	border-color: var(--slj-accent);
	color: #fff;
}
