/*
 * Single pages — one discussion, one piece of news, one event
 * (single-discussion.php, parts/news-single.php, parts/sp-hero.php,
 * parts/sp-share.php). Loaded only on those, after public.css.
 *
 * The page opens on the post's own picture, full width under a dark scrim,
 * with the title set large on it. Below, the text reads in one comfortable
 * column; beside it a sticky column carries what one does with the page —
 * vote, share, go back. Then more of the same kind.
 */

.arm-sp {
	background: var(--arm-bg);
}

/* ------------------------------------------------------------------ hero */

.arm-sp__hero {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: clamp(380px, 46vw, 580px);
	overflow: hidden;
	isolation: isolate;
	background: linear-gradient(135deg, #7a5344 0%, #5a3b30 55%, #3f2a22 100%);
	color: #fff;
}

.arm-sp__hero-img {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transform: scale(1.06);
	animation: arm-sp-settle 14s cubic-bezier(0.2, 0.7, 0.2, 1) forwards;
}

@keyframes arm-sp-settle {
	to {
		transform: scale(1);
	}
}

.arm-sp__scrim {
	position: absolute;
	inset: 0;
	z-index: -1;
	background:
		linear-gradient(180deg, rgba(22, 15, 11, 0.2) 0%, rgba(22, 15, 11, 0.18) 35%, rgba(22, 15, 11, 0.86) 100%),
		linear-gradient(90deg, rgba(22, 15, 11, 0.45) 0%, rgba(22, 15, 11, 0) 60%);
}

/* No picture: the house brown, with the chamber's arch drawn large. */
.arm-sp__hero--plain .arm-sp__scrim {
	background:
		radial-gradient(circle at 85% 120%, transparent 0 34%, rgba(211, 163, 73, 0.28) 34.2% 34.6%, transparent 34.8% 40%, rgba(211, 163, 73, 0.2) 40.2% 40.6%, transparent 40.8%),
		linear-gradient(180deg, rgba(0, 0, 0, 0) 40%, rgba(0, 0, 0, 0.35) 100%);
}

.arm-sp__hero-inner {
	position: relative;
	width: 100%;
	padding-block: 56px 46px;
}

.arm-sp__crumbs {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	margin-bottom: 18px;
	font-size: 13px;
	letter-spacing: 0.06em;
	color: rgba(255, 255, 255, 0.78);
}

.arm-sp__crumbs a {
	color: #fff;
	text-decoration: none;
	border-bottom: 1px solid rgba(255, 255, 255, 0.4);
	transition: border-color 0.2s ease;
}

.arm-sp__crumbs a:hover {
	border-color: var(--arm-gold);
}

.arm-sp__crumb-sep {
	color: var(--arm-gold);
}

.arm-sp__badge {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	margin: 0 0 18px;
	padding: 6px 15px 6px 12px;
	border: 1px solid rgba(255, 255, 255, 0.28);
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.12);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.14em;
	text-transform: uppercase;
}

.arm-sp__badge::before {
	content: "";
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #7ed6a0;
	box-shadow: 0 0 0 0 rgba(126, 214, 160, 0.6);
	animation: arm-sp-pulse 2.4s ease-out infinite;
}

.arm-sp__badge--closed::before {
	background: #c9c1b8;
	animation: none;
}

/* News carries no state: a still gold mark. */
.arm-sp__badge--news::before {
	background: var(--arm-gold);
	box-shadow: none;
	animation: none;
}

@keyframes arm-sp-pulse {
	70% {
		box-shadow: 0 0 0 9px rgba(126, 214, 160, 0);
	}

	100% {
		box-shadow: 0 0 0 0 rgba(126, 214, 160, 0);
	}
}

.arm-sp__title {
	max-width: 940px;
	margin: 0;
	font-family: var(--arm-font-head);
	font-size: clamp(38px, 5.6vw, 80px);
	font-weight: 400;
	line-height: 0.98;
	letter-spacing: 0.03em;
	text-shadow: 0 2px 26px rgba(0, 0, 0, 0.35);
	overflow-wrap: anywhere;
}

.arm-sp__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 28px;
	margin: 24px 0 0;
	padding: 18px 0 0;
	border-top: 1px solid rgba(255, 255, 255, 0.24);
	list-style: none;
	font-size: 14px;
	color: rgba(255, 255, 255, 0.92);
}

.arm-sp__facts li {
	display: inline-flex;
	align-items: center;
	gap: 9px;
}

.arm-sp__facts .arm-icon-svg {
	width: 18px;
	height: 18px;
	color: var(--arm-gold);
}

/* ---------------------------------------------------------------- layout */

.arm-sp__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	grid-template-areas:
		"content side"
		"thread side";
	align-items: start;
	column-gap: 64px;
	padding-block: 60px 80px;
}

/* ------------------------------------------------------------------ text */

.arm-sp__content {
	grid-area: content;
	min-width: 0;
	max-width: 760px;
	font-size: 18px;
	line-height: 1.8;
	color: #2c2825;
}

.arm-sp__content > :first-child {
	margin-top: 0;
}

.arm-sp__content p {
	margin: 0 0 1.1em;
}

/* In an article, the first paragraph is the standfirst, opened by a drop
   capital (the template adds --lead only when the text is long enough). */
.arm-sp__content--lead > p:first-of-type {
	font-size: 21px;
	line-height: 1.65;
	color: var(--arm-text);
}

.arm-sp__content--lead > p:first-of-type::first-letter {
	float: left;
	margin: 8px 12px 0 0;
	font-family: var(--arm-font-head);
	font-size: 78px;
	line-height: 0.78;
	color: var(--arm-brown);
}

.arm-sp__content h2,
.arm-sp__content h3 {
	margin: 1.6em 0 0.6em;
	font-family: var(--arm-font-head);
	font-weight: 400;
	line-height: 1.1;
	letter-spacing: 0.05em;
	color: var(--arm-text);
}

.arm-sp__content h2 {
	font-size: 32px;
}

.arm-sp__content h3 {
	font-size: 24px;
}

.arm-sp__content a {
	color: var(--arm-brown);
	text-decoration-color: rgba(111, 75, 62, 0.35);
	text-underline-offset: 4px;
}

.arm-sp__content a:hover {
	text-decoration-color: currentColor;
}

.arm-sp__content img {
	max-width: 100%;
	height: auto;
	border-radius: 14px;
}

.arm-sp__content figure {
	margin: 1.6em 0;
}

.arm-sp__content figcaption {
	margin-top: 8px;
	font-size: 13px;
	color: var(--arm-muted);
	text-align: center;
}

.arm-sp__content blockquote {
	margin: 1.6em 0;
	padding: 6px 0 6px 24px;
	border-left: 3px solid var(--arm-gold);
	font-size: 21px;
	font-style: italic;
	line-height: 1.6;
	color: var(--arm-brown);
}

.arm-sp__content ul,
.arm-sp__content ol {
	padding-left: 1.3em;
}

.arm-sp__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 36px 0 0;
	padding: 0;
	list-style: none;
}

.arm-sp__tags li {
	padding: 6px 14px;
	border: 1px solid var(--arm-line);
	border-radius: 999px;
	background: var(--arm-surface);
	font-size: 13px;
	font-weight: 600;
	color: var(--arm-brown);
}

/* ------------------------------------------------------------- side column */

.arm-sp__side {
	position: sticky;
	top: calc(var(--arm-header-h) + 24px);
	grid-area: side;
	display: grid;
	gap: 16px;
}

.arm-sp__card {
	padding: 22px;
	border: 1px solid rgba(0, 0, 0, 0.04);
	border-radius: 18px;
	background: var(--arm-surface);
	box-shadow: 0 20px 44px -30px rgba(40, 30, 20, 0.5);
}

.arm-sp__label {
	margin: 0 0 14px;
	font-size: 11.5px;
	font-weight: 700;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--arm-brown);
}

/* Where the community stands: the two shares, and a bar split between them. */
.arm-sp__meter-nums {
	display: flex;
	justify-content: space-between;
	gap: 12px;
	font-size: 13px;
	color: var(--arm-muted);
}

.arm-sp__meter-nums strong {
	display: block;
	font-family: var(--arm-font-head);
	font-size: 38px;
	font-weight: 400;
	line-height: 1;
	color: var(--arm-brown);
}

.arm-sp__meter-against {
	text-align: right;
}

.arm-sp__meter-against strong {
	color: #8d8883;
}

.arm-sp__meter-bar {
	position: relative;
	height: 10px;
	margin: 14px 0 8px;
	overflow: hidden;
	border-radius: 999px;
	background: #ddd7d0;
}

.arm-sp__meter-fill {
	position: absolute;
	inset: 0 auto 0 0;
	width: var(--agree, 50%);
	border-radius: inherit;
	background: linear-gradient(90deg, #5f3f33, var(--arm-brown) 60%, #a07560);
	transition: width 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.arm-sp__meter.is-empty .arm-sp__meter-fill {
	background: #cbc3ba;
}

.arm-sp__meter.is-empty strong {
	color: #c2bab1;
}

.arm-sp__meter-total {
	margin: 0 0 18px;
	font-size: 12.5px;
	text-align: center;
	color: var(--arm-muted);
}

/* The ballot, as two tall buttons under the meter. */
.arm-sp .arm-dvote {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 10px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}

.arm-sp .arm-dvote__btn {
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	padding: 14px 8px;
	border-radius: 14px;
	font-size: 13px;
	font-weight: 600;
}

.arm-sp .arm-dvote__btn .arm-icon-svg {
	width: 24px;
	height: 24px;
}

.arm-sp .arm-dvote__label {
	display: block;
}

.arm-sp .arm-dvote__count {
	font-size: 15px;
}

.arm-sp .arm-dvote__hint {
	grid-column: 1 / -1;
	font-size: 12.5px;
	text-align: center;
}

/* When and where (news, events). */
.arm-sp__when-date {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	font-family: var(--arm-font-head);
	font-size: 26px;
	line-height: 1.1;
	letter-spacing: 0.03em;
	white-space: pre;
	color: var(--arm-text);
}

.arm-sp__when-line {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 12px 0 0;
	font-size: 15px;
	font-weight: 600;
	color: var(--arm-text);
}

.arm-sp__when-date .arm-icon-svg,
.arm-sp__when-line .arm-icon-svg {
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	color: var(--arm-brown);
}

.arm-sp__when-line a {
	color: var(--arm-brown);
	text-decoration: underline;
	text-decoration-color: rgba(111, 75, 62, 0.35);
	text-underline-offset: 4px;
}

/* Sharing. */
.arm-sp__share-row {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.arm-sp__share-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 46px;
	height: 46px;
	padding: 0 13px;
	border: 1px solid var(--arm-line);
	border-radius: 12px;
	background: var(--arm-surface);
	color: var(--arm-brown);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.arm-sp__share-btn .arm-icon-svg {
	width: 18px;
	height: 18px;
}

.arm-sp__share-btn:hover,
.arm-sp__share-btn:focus-visible {
	border-color: var(--arm-brown);
	background: var(--arm-brown);
	color: #fff;
}

.arm-sp__share-copy {
	flex: 1 1 auto;
}

.arm-sp__share-copy.is-done {
	border-color: #2f7a4f;
	background: #2f7a4f;
	color: #fff;
}

.arm-sp__back {
	display: inline-flex;
	align-items: center;
	justify-self: start;
	gap: 6px;
	padding: 6px 2px;
	font-size: 14px;
	font-weight: 600;
	color: var(--arm-brown);
	text-decoration: none;
	transition: transform 0.2s ease;
}

.arm-sp__back:hover {
	transform: translateX(-3px);
}

/* ---------------------------------------------------------------- thread */

.arm-sp__thread {
	grid-area: thread;
	min-width: 0;
	max-width: 760px;
}

.arm-sp .arm-comments {
	max-width: none;
	margin-top: 56px;
	padding-top: 44px;
	border-top: 1px solid var(--arm-line);
}

.arm-sp .arm-comments__head {
	margin-bottom: 26px;
}

.arm-sp .arm-comments__title {
	font-family: var(--arm-font-head);
	font-size: 30px;
	font-weight: 400;
	letter-spacing: 0.06em;
}

.arm-sp .arm-comment {
	margin-bottom: 16px;
}

.arm-sp .arm-comment__row {
	gap: 14px;
}

.arm-sp .arm-comment__avatar img {
	width: 44px;
	height: 44px;
	box-shadow: 0 0 0 2px var(--arm-bg), 0 0 0 3.5px var(--arm-gold);
}

.arm-sp .arm-comment__bubble {
	display: block;
	padding: 14px 18px 15px;
	border-radius: 4px 18px 18px 18px;
	background: var(--arm-surface);
	box-shadow: 0 12px 28px -22px rgba(40, 30, 20, 0.5);
}

.arm-sp .arm-comment__author {
	margin-bottom: 3px;
	font-size: 14px;
	color: var(--arm-brown);
}

.arm-sp .arm-comment__text {
	font-size: 15px;
	line-height: 1.65;
	color: #2c2825;
}

.arm-sp .arm-comment__actions {
	margin: 6px 0 0 18px;
}

/* Replies hang off a thin gold thread. */
.arm-sp .arm-comment__replies {
	margin-top: 14px;
	padding-left: 18px;
	border-left: 2px solid rgba(211, 163, 73, 0.45);
}

.arm-sp .arm-comment__replies .arm-comment__avatar img {
	width: 36px;
	height: 36px;
}

.arm-sp .arm-comments__more {
	margin-left: 58px;
}

.arm-sp .arm-comment-form .arm-input,
.arm-sp .arm-comment-form textarea {
	min-height: 120px;
	padding: 14px 16px;
	border: 1px solid var(--arm-line);
	border-radius: 14px;
	background: var(--arm-surface);
	font-size: 15px;
	line-height: 1.6;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.arm-sp .arm-comment-form .arm-input:focus,
.arm-sp .arm-comment-form textarea:focus {
	border-color: var(--arm-gold);
	outline: none;
	box-shadow: 0 0 0 4px rgba(211, 163, 73, 0.2);
}

.arm-sp .arm-comments__notice {
	padding: 18px 22px;
	border: 1px dashed var(--arm-line);
	border-radius: 14px;
	background: var(--arm-surface);
	font-size: 14px;
	text-align: center;
	color: var(--arm-muted);
}

.arm-sp .arm-comments__notice a {
	color: var(--arm-brown);
	font-weight: 700;
}

/* ------------------------------------------------------------------- more */

.arm-sp__more {
	padding-block: 60px 76px;
	border-top: 1px solid var(--arm-line);
	background: rgba(255, 255, 255, 0.55);
}

.arm-sp__more-head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px 24px;
	margin-bottom: 28px;
}

.arm-sp__more-title {
	margin: 0;
	font-family: var(--arm-font-head);
	font-size: clamp(26px, 2.8vw, 36px);
	font-weight: 400;
	letter-spacing: 0.06em;
}

.arm-sp__more-all {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 14px;
	font-weight: 700;
	color: var(--arm-brown);
	text-decoration: none;
}

.arm-sp__more-all svg {
	transition: transform 0.2s ease;
}

.arm-sp__more-all:hover svg {
	transform: translateX(3px);
}

.arm-sp__more .arm-dcards {
	margin-top: 0;
}

/* ------------------------------------------------------------- responsive */

@media (max-width: 1100px) {
	.arm-sp__layout {
		grid-template-columns: minmax(0, 1fr) 300px;
		column-gap: 40px;
	}
}

@media (max-width: 900px) {
	/* One column: the text, then the ballot and sharing, then the thread. */
	.arm-sp__layout {
		grid-template-columns: minmax(0, 1fr);
		grid-template-areas:
			"content"
			"side"
			"thread";
		row-gap: 36px;
		padding-block: 40px 60px;
	}

	.arm-sp__side {
		position: static;
	}

	.arm-sp__content {
		font-size: 17px;
	}

	.arm-sp__content--lead > p:first-of-type {
		font-size: 19px;
	}

	.arm-sp .arm-comments {
		margin-top: 8px;
	}
}

@media (max-width: 600px) {
	.arm-sp__hero {
		min-height: 360px;
	}

	.arm-sp__hero-inner {
		padding-block: 36px 30px;
	}

	.arm-sp__facts {
		gap: 8px 18px;
		font-size: 13px;
	}

	.arm-sp__content--lead > p:first-of-type::first-letter {
		font-size: 62px;
	}

	.arm-sp .arm-comment__bubble {
		padding: 12px 14px;
	}

	.arm-sp .arm-comment__replies {
		padding-left: 12px;
	}

	.arm-sp .arm-comments__more {
		margin-left: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	.arm-sp__hero-img,
	.arm-sp__badge::before {
		animation: none;
	}

	.arm-sp__hero-img {
		transform: none;
	}
}
