/*
 * The articles' pages (the articles switch): an article (cms/article.twig) and a topic's list (cms/topic.twig), for the
 * desktop and phone themes alike. Colours from tokens.css. Text on the dark banner names its colour outright: the
 * shops' paragraph colour (sb.css, sb-mobile.css) would otherwise win.
 */

.sb-article {
	color: var(--sb-text);
}

/* The phone theme hides #content's overflow, which would stop the section tabs sticking: clip keeps them working */
.sb-article #content {
	display: flow-root;
	overflow: visible;
	overflow: clip;
	padding-bottom: 32px;
}

/* The banner: the article's image under a fade of the shop's ink colour (darkened, for white text on any photo), or
   the ink colour alone without one */
#sb-article .sb-article-hero {
	--sb-hero-shade: color-mix(in srgb, var(--sb-ink) 70%, #000);
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 240px;
	margin: 0 0 8px;
	padding: 40px 40px 28px;
	border-radius: var(--sb-radius-card);
	background-color: var(--sb-ink);
	color: #fff;
}

#sb-article .sb-article-hero.has-photo {
	min-height: 320px;
	background-image: linear-gradient(90deg, var(--sb-hero-shade) 0%, color-mix(in srgb, var(--sb-hero-shade) 85%, transparent) 45%, color-mix(in srgb, var(--sb-hero-shade) 27%, transparent) 100%), var(--sb-hero);
	background-size: cover;
	background-position: center 35%;
}

#sb-article .sb-article-hero h1,
#sb-article .sb-article-hero p,
#sb-article .sb-article-hero a {
	color: #fff;
}

#sb-article .sb-article-kicker {
	margin: 0 0 6px;
	font-size: 15px;
	font-weight: 500;
	opacity: 0.9;
}

#sb-article #content .sb-article-kicker a {
	text-decoration: none;
}

#sb-article #content .sb-article-kicker a:hover {
	text-decoration: underline;
}

#sb-article .sb-article-hero h1 {
	margin: 0 0 10px;
	font-size: 44px;
	font-weight: 700;
	line-height: 1.1;
	text-transform: none;
}

#sb-article .sb-article-lead {
	max-width: 760px;
	margin: 0 0 6px;
	font-size: 18px;
	line-height: 1.5;
}

/* The topic's other articles */
.sb-article-siblings {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

#sb-article .sb-article-siblings a {
	display: inline-flex;
	align-items: center;
	min-height: 36px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, 0.55);
	border-radius: 999px;
	font-weight: 600;
	text-decoration: none;
}

#sb-article .sb-article-siblings a[aria-current] {
	border-color: #fff;
	background: #fff;
	color: var(--sb-ink);
}

#sb-article .sb-article-siblings a:not([aria-current]):hover {
	background: rgba(255, 255, 255, 0.12);
}

/* Tabs to the article's sections (articles.js makes them from its h2 headings) */
.sb-article-tabs {
	position: sticky;
	top: 0;
	z-index: 5;
	display: flex;
	gap: 28px;
	margin: 20px 0 0;
	overflow-x: auto;
	border-bottom: 1px solid var(--sb-line);
	background: #fff;
	scrollbar-width: none;
}

#sb-article .sb-article-tabs a {
	display: inline-flex;
	flex: 0 0 auto;
	align-items: center;
	min-height: 48px;
	margin-bottom: -1px;
	border-bottom: 3px solid transparent;
	font-weight: 600;
	color: var(--sb-text);
	text-decoration: none;
}

#sb-article .sb-article-tabs a.is-active {
	border-bottom-color: var(--sb-brand);
	color: var(--sb-ink);
}

/* The article's text */
.sb-article-body {
	max-width: 860px;
	padding-top: 8px;
	font-size: 16px;
	line-height: 1.65;
}

.sb-article-body h2 {
	scroll-margin-top: 64px;
	margin: 36px 0 14px;
	font-size: 26px;
	font-weight: 600;
	color: var(--sb-ink);
	text-transform: none;
}

.sb-article-body h3 {
	margin: 24px 0 10px;
	font-size: 19px;
	color: var(--sb-ink);
	text-transform: none;
}

.sb-article-body h4 {
	margin: 20px 0 6px;
	font-size: 16px;
	font-weight: 600;
	color: var(--sb-ink);
	text-transform: none;
}

.sb-article-body ul,
.sb-article-body ol {
	margin: 0 0 14px;
}

.sb-article-body img {
	max-width: 100%;
	height: auto;
	border-radius: var(--sb-radius);
}

/* Blocks in the text (admin event/blocks.php, event/articles.php): tabs, folded sections, people */
.sb-tabs,
.sb-folds,
.sb-people {
	margin: 20px 0 24px;
}

/* The tabs wrap onto a second line rather than hide past the edge */
.sb-tabs-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0 24px;
	border-bottom: 1px solid var(--sb-line);
}

#sb-article .sb-tabs-tab {
	flex: 0 0 auto;
	min-height: 44px;
	margin-bottom: -1px;
	padding: 0;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	font-size: 16px;
	font-weight: 600;
	color: var(--sb-text);
}

#sb-article .sb-tabs-tab[aria-selected="true"] {
	border-bottom-color: var(--sb-brand);
	color: var(--sb-ink);
}

.sb-tab-panel {
	padding-top: 12px;
}

.sb-tabs.is-ready .sb-tab-panel > h3 {
	display: none;
}

.sb-fold {
	border-bottom: 1px solid var(--sb-line);
}

.sb-fold:first-child {
	border-top: 1px solid var(--sb-line);
}

.sb-fold summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	min-height: 52px;
	cursor: pointer;
	list-style: none;
}

.sb-fold summary::-webkit-details-marker {
	display: none;
}

.sb-fold summary::after {
	content: "";
	flex: 0 0 auto;
	width: 10px;
	height: 10px;
	margin-right: 4px;
	border-right: 2px solid var(--sb-ink);
	border-bottom: 2px solid var(--sb-ink);
	transform: rotate(45deg) translateY(-3px);
	transition: transform 0.15s;
}

.sb-fold[open] summary::after {
	transform: rotate(-135deg) translateY(-3px);
}

.sb-article-body .sb-fold summary h3 {
	margin: 0;
	font-size: 18px;
}

.sb-fold > :not(summary) {
	margin-bottom: 14px;
}

.sb-people {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 24px 20px;
}

.sb-article-body .sb-person img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	border-radius: var(--sb-radius-card);
	background: var(--sb-surface);
}

/* A person without a photo: their initials in the photo's place */
.sb-person-initials {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	aspect-ratio: 3 / 4;
	border-radius: var(--sb-radius-card);
	background: var(--sb-surface);
	color: var(--sb-muted);
	font-size: 44px;
	font-weight: 600;
	letter-spacing: 0.04em;
}

.sb-article-body .sb-person h3 {
	margin: 10px 0 2px;
	font-size: 17px;
	line-height: 1.3;
}

.sb-person p {
	margin: 0 0 4px;
	font-size: 15px;
	line-height: 1.5;
}

#sb-article .sb-person .sb-person-role {
	color: var(--sb-muted);
}

.sb-person-bio summary {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 32px;
	font-weight: 600;
	color: var(--sb-ink);
	text-decoration: underline;
	cursor: pointer;
	list-style: none;
}

.sb-person-bio summary::-webkit-details-marker {
	display: none;
}

.sb-person-bio[open] summary {
	margin-bottom: 4px;
}

@media print {
	.sb-tabs-list {
		display: none;
	}

	.sb-tabs.is-ready .sb-tab-panel > h3 {
		display: block;
	}
}

/* An article's albums (cms/albums.twig): one album's photos as a grid, several albums as cover cards */
.sb-album-meta {
	margin: 0 0 4px;
	color: var(--sb-muted);
}

.sb-album-meta strong {
	color: var(--sb-ink);
}

.sb-album-description {
	margin: 0 0 12px;
}

.sb-album-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
	gap: 8px;
	margin: 12px 0 0;
}

.sb-album-grid .sb-album-photo {
	display: block;
	overflow: hidden;
	border-radius: var(--sb-radius);
	background: var(--sb-surface);
}

.sb-article-body .sb-album-grid img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 0;
	transition: transform 0.2s;
}

.sb-album-grid .sb-album-photo:hover img {
	transform: scale(1.04);
}

.sb-album-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
	gap: 16px;
	margin: 12px 0 0;
}

#sb-article .sb-album-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
	border: 1px solid var(--sb-line);
	border-radius: var(--sb-radius-card);
	background: #fff;
	color: var(--sb-text);
	text-decoration: none;
}

#sb-article .sb-album-card:hover {
	box-shadow: var(--sb-shadow);
}

.sb-article-body .sb-album-card img {
	display: block;
	width: 100%;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: 0;
	background: var(--sb-surface);
}

.sb-album-card-text {
	display: block;
	padding: 12px 14px 14px;
	line-height: 1.4;
}

.sb-album-card-text strong {
	display: block;
	margin: 0 0 4px;
	font-size: 17px;
	color: var(--sb-ink);
}

.sb-album-card-text small {
	display: block;
	font-size: 14px;
	color: var(--sb-muted);
}

/* The popup's caption and counter on the dark background */
.mfp-title {
	padding-right: 72px;
	line-height: 1.4;
}

/* A topic's list */
.sb-topic-head {
	max-width: 860px;
	margin: 0 0 24px;
}

.sb-topic-head h1 {
	margin: 0 0 10px;
	font-size: 34px;
	color: var(--sb-ink);
	text-transform: none;
}

.sb-topic-intro {
	font-size: 17px;
	line-height: 1.6;
}

.sb-topic-cards {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin: 0 0 24px;
}

#sb-article .sb-topic-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--sb-line);
	border-radius: var(--sb-radius-card);
	background: #fff;
	color: var(--sb-text);
	text-decoration: none;
}

#sb-article .sb-topic-card:hover {
	box-shadow: var(--sb-shadow);
}

.sb-topic-card img,
.sb-topic-noimage {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	background: var(--sb-surface);
}

.sb-topic-card-text {
	display: block;
	padding: 14px 16px 16px;
}

.sb-topic-card-text strong {
	display: block;
	margin: 0 0 4px;
	font-size: 18px;
	line-height: 1.3;
	color: var(--sb-ink);
}

.sb-topic-card-text .sb-topic-card-date {
	display: block;
	margin: 0 0 8px;
	font-size: 13px;
	color: var(--sb-muted);
}

.sb-topic-card-text small {
	display: block;
	font-size: 14px;
	line-height: 1.5;
	color: var(--sb-muted);
}

@media (max-width: 767px) {
	#sb-article .sb-article-hero {
		min-height: 220px;
		padding: 28px 18px 20px;
	}

	#sb-article .sb-article-hero.has-photo {
		min-height: 280px;
		background-image: linear-gradient(0deg, var(--sb-hero-shade) 0%, color-mix(in srgb, var(--sb-hero-shade) 75%, transparent) 60%, color-mix(in srgb, var(--sb-hero-shade) 37%, transparent) 100%), var(--sb-hero);
	}

	#sb-article .sb-article-hero h1 {
		font-size: 30px;
	}

	#sb-article .sb-article-lead {
		font-size: 16px;
	}

	.sb-article-tabs {
		gap: 20px;
	}

	.sb-article-body h2 {
		font-size: 22px;
	}

	.sb-topic-head h1 {
		font-size: 28px;
	}

	.sb-people {
		grid-template-columns: repeat(2, 1fr);
		gap: 18px 12px;
	}

	.sb-tabs-list {
		gap: 0 18px;
	}

	.sb-album-grid {
		grid-template-columns: repeat(3, 1fr);
		gap: 4px;
	}

	.sb-album-cards {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.sb-album-card-text {
		padding: 10px;
	}

	.sb-album-card-text strong {
		font-size: 15px;
	}
}
