.portrait-community-public,
.portrait-community-thread {
	box-sizing: border-box;
	margin-inline: auto;
	max-width: 1180px;
	padding: 24px 16px 48px;
	width: 100%;
}

.portrait-community-public__intro {
	margin-bottom: 12px;
}

.portrait-community-public__intro h1 {
	font-size: clamp(1.45rem, 3vw, 2rem);
	margin: 0 0 4px;
}

.portrait-community-public__intro p {
	color: var(--pc-color-text-supporting, #343a3d);
	margin: 0;
}

.portrait-community-public__section {
	margin-top: 36px;
	scroll-margin-top: 20px;
}

.portrait-community-public__section--first {
	margin-top: 20px;
}

.portrait-community-front-entry a,
.portrait-community-card__button {
	border: 1px solid currentcolor;
	border-radius: 5px;
	display: inline-flex;
	min-height: 44px;
	padding: 9px 14px;
	text-decoration: none;
}

.portrait-community-breadcrumb {
	font-size: 0.95rem;
	font-weight: 500;
	margin: 8px 0 28px;
	overflow-wrap: anywhere;
}

.portrait-community-breadcrumb ol {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 5px 10px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.portrait-community-breadcrumb li {
	min-width: 0;
}

.portrait-community-breadcrumb li:not(:last-child)::after {
	color: var(--pc-color-text-supporting, #343a3d);
	content: "›";
	font-weight: 600;
	margin-left: 10px;
}

.portrait-community-breadcrumb a {
	color: var(--pc-color-accent, #315f73);
	text-decoration: underline;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.25em;
}

.portrait-community-breadcrumb a:hover,
.portrait-community-breadcrumb a:focus-visible {
	text-decoration-thickness: 0.14em;
}

.portrait-community-breadcrumb [aria-current="page"] {
	color: var(--pc-color-text, #171a1c);
	font-weight: 600;
}

.portrait-community-grid {
	display: grid;
	gap: 18px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portrait-community-grid--active-threads {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portrait-community-card {
	background: #fff;
	border: 1px solid #dcdcde;
	border-radius: 8px;
	display: flex;
	flex-direction: column;
	min-width: 0;
	overflow: hidden;
	padding: 18px;
}

.portrait-community-card h3 {
	font-size: 1.1rem;
	margin: 0 0 12px;
	overflow-wrap: anywhere;
}

.portrait-community-card--category {
	padding: 16px;
}

.portrait-community-card--category h3 {
	margin-bottom: 6px;
}

.portrait-community-card__count {
	color: var(--pc-color-text-supporting, #343a3d);
	font-size: 1.25rem;
	font-variant-numeric: tabular-nums;
	font-weight: 500;
	margin: 0;
}

.portrait-community-card--active-thread {
	aspect-ratio: 4 / 3;
	background: #1d2327;
	border-color: transparent;
	isolation: isolate;
	padding: 0;
	position: relative;
}

.portrait-community-active-thread__image-link {
	background: #1d2327;
	display: block;
	inset: 0;
	position: absolute;
}

.portrait-community-active-thread__image {
	display: block;
	height: 100%;
	object-fit: cover;
	object-position: center;
	width: 100%;
}

.portrait-community-active-thread__overlay {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.62) 58%, rgba(0, 0, 0, 0) 100%);
	bottom: 0;
	color: #fff;
	left: 0;
	padding: 52px 16px 15px;
	pointer-events: none;
	position: absolute;
	right: 0;
	z-index: 1;
}

.portrait-community-active-thread__overlay h3 {
	display: -webkit-box;
	line-height: 1.35;
	margin-bottom: 6px;
	max-height: 4.05em;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.portrait-community-active-thread__category,
.portrait-community-active-thread__activity {
	color: #fff;
	font-size: 0.9rem;
	margin: 4px 0 0;
}

.portrait-community-active-thread__activity {
	display: flex;
	flex-wrap: wrap;
	gap: 3px 10px;
	line-height: 1.45;
}

.portrait-community-active-thread__activity time,
.portrait-community-masonry__published time {
	font-variant-numeric: tabular-nums;
}

.portrait-community-active-thread__overlay a {
	color: #fff;
	pointer-events: auto;
	text-decoration-color: rgba(255, 255, 255, 0.72);
	text-underline-offset: 0.16em;
}

.portrait-community-active-thread__image-link:focus-visible,
.portrait-community-active-thread__overlay a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -4px;
}

.portrait-community-category__description {
	max-width: 62rem;
}

.portrait-community-category__meta {
	align-items: baseline;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	margin: 14px 0 0;
}

.portrait-community-category__meta p {
	color: var(--pc-color-text-supporting, #343a3d);
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
	line-height: 1.55;
	margin: 0;
}

.portrait-community-grid--category-current,
.portrait-community-grid--category-past {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

.portrait-community-category-thread {
	aspect-ratio: 4 / 3;
	background: #1d2327;
	border: 1px solid #2c3338;
	border-radius: 8px;
	isolation: isolate;
	min-width: 0;
	overflow: hidden;
	position: relative;
}

.portrait-community-category-thread--past {
	aspect-ratio: 16 / 10;
	border-color: #8c8f94;
}

.portrait-community-category-thread__image-link {
	background: #1d2327;
	display: block;
	inset: 0;
	position: absolute;
}

.portrait-community-category-thread__image {
	display: block;
	height: 100%;
	object-fit: cover;
	object-position: center;
	width: 100%;
}

.portrait-community-category-thread__placeholder {
	align-items: center;
	color: var(--pc-color-text-supporting, #343a3d);
	display: flex;
	inset: 0;
	justify-content: center;
	padding: 24px;
	position: absolute;
	text-align: center;
}

.portrait-community-category-thread__overlay {
	background: linear-gradient(to top, rgba(0, 0, 0, 0.94) 0%, rgba(0, 0, 0, 0.72) 62%, rgba(0, 0, 0, 0.08) 100%);
	bottom: 0;
	color: #fff;
	left: 0;
	padding: 58px 16px 15px;
	pointer-events: none;
	position: absolute;
	right: 0;
	z-index: 1;
}

.portrait-community-category-thread--past .portrait-community-category-thread__overlay {
	padding-top: 44px;
}

.portrait-community-category-thread__overlay h3 {
	display: -webkit-box;
	font-size: 1.08rem;
	line-height: 1.35;
	margin: 0 0 7px;
	max-height: 4.05em;
	overflow: hidden;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.portrait-community-category-thread__overlay a {
	color: #fff;
	pointer-events: auto;
	text-decoration-color: rgba(255, 255, 255, 0.78);
	text-underline-offset: 0.16em;
}

.portrait-community-category-thread__counts,
.portrait-community-category-thread__updated,
.portrait-community-category-thread__status {
	display: flex;
	flex-wrap: wrap;
	font-size: 0.86rem;
	gap: 3px 10px;
	line-height: 1.45;
	margin: 4px 0 0;
}

.portrait-community-category-thread__counts,
.portrait-community-category-thread__updated {
	font-variant-numeric: tabular-nums;
}

.portrait-community-category-thread__status {
	font-weight: 700;
}

.portrait-community-category-thread__image-link:focus-visible,
.portrait-community-category-thread__overlay a:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -4px;
}

.portrait-community-category__past {
	border-top: 1px solid #dcdcde;
	padding-top: 26px;
}

.portrait-community-category__empty {
	color: var(--pc-color-text-supporting, #343a3d);
	font-weight: 500;
	margin-top: 18px;
}

.portrait-community-category-links {
	margin-top: 64px;
}

.portrait-community-category-links h2 {
	font-size: 1.05rem;
	margin: 0 0 10px;
}

.portrait-community-category-links ul {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 20px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.portrait-community-category-links a {
	align-items: center;
	display: inline-flex;
	min-height: 44px;
	padding: 8px 0;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.16em;
}

.portrait-community-category-links a:hover,
.portrait-community-category-links a:focus-visible {
	color: var(--pc-color-accent, #315f73);
	text-decoration: underline;
	text-underline-offset: 0.16em;
}

.portrait-community-category-links a:focus-visible {
	outline: 3px solid var(--pc-color-accent, #315f73);
	outline-offset: 2px;
}

.portrait-community-category-links__arrow {
	color: var(--pc-color-accent, #315f73);
	font-size: 1.1em;
	margin-left: 6px;
}

.portrait-community-masonry {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.portrait-community-masonry.is-enhanced {
	align-items: start;
	grid-auto-rows: 8px;
}

.portrait-community-masonry__item {
	align-self: start;
	background: #fff;
	min-width: 0;
	overflow: hidden;
}

.portrait-community-masonry__image-link {
	background: #1d2327;
	display: block;
}

.portrait-community-masonry__image {
	display: block;
	height: auto;
	max-width: 100%;
	width: 100%;
}

.portrait-community-masonry__caption {
	padding: 8px 4px 4px;
}

.portrait-community-masonry__caption p {
	margin: 3px 0 0;
	overflow-wrap: anywhere;
}

.portrait-community-masonry__caption a {
	text-underline-offset: 0.14em;
}

.portrait-community-masonry__author {
	font-size: 0.94rem;
	font-weight: 600;
}

.portrait-community-masonry__thread {
	display: -webkit-box;
	color: var(--pc-color-text-supporting, #343a3d);
	font-size: 0.86rem;
	font-weight: 500;
	line-height: 1.4;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.portrait-community-masonry__published {
	color: var(--pc-color-text-supporting, #343a3d);
	font-size: 0.84rem;
	font-weight: 500;
	line-height: 1.45;
}

.portrait-community-masonry__image-link:focus-visible,
.portrait-community-masonry__caption a:focus-visible {
	outline: 3px solid #2271b1;
	outline-offset: 2px;
}

.portrait-community-card__details {
	list-style: none;
	margin: 0 0 16px;
	padding: 0;
}

.portrait-community-card__details li,
.portrait-community-card__meta {
	color: var(--pc-color-text-supporting, #343a3d);
	font-size: 0.95rem;
	font-weight: 500;
	margin-bottom: 5px;
}

.portrait-community-card__button {
	align-items: center;
	justify-content: center;
	margin-top: auto;
}

.portrait-community-card__image-link {
	align-items: center;
	background: #f0f0f1;
	display: flex;
	justify-content: center;
	margin: -18px -18px 16px;
	min-height: 180px;
	overflow: hidden;
}

.portrait-community-card__image {
	display: block;
	height: auto;
	max-height: 320px;
	max-width: 100%;
	object-fit: contain;
	width: auto;
}

.portrait-community-card__placeholder {
	color: var(--pc-color-text-supporting, #343a3d);
	font-weight: 500;
	padding: 32px 16px;
	text-align: center;
}

.portrait-community-front-entry {
	background: #fff;
	border-bottom: 1px solid #dcdcde;
	padding: 12px 16px;
}

.portrait-community-front-entry a {
	align-items: center;
	gap: 10px;
	justify-content: center;
	margin-inline: auto;
	max-width: 560px;
}

.portrait-community-thread__photos {
	border-top: 1px solid #dcdcde;
	padding-top: 24px;
}

@media (max-width: 800px) {
	.portrait-community-grid,
	.portrait-community-grid--active-threads,
	.portrait-community-grid--category-current,
	.portrait-community-grid--category-past {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.portrait-community-masonry {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.portrait-community-public,
	.portrait-community-thread {
		padding-inline: 12px;
	}

	.portrait-community-grid,
	.portrait-community-grid--active-threads,
	.portrait-community-grid--category-current,
	.portrait-community-grid--category-past {
		grid-template-columns: minmax(0, 1fr);
	}

	.portrait-community-masonry {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.portrait-community-card__image-link {
		min-height: 150px;
	}

	.portrait-community-card--active-thread {
		aspect-ratio: 16 / 11;
	}

	.portrait-community-category-thread,
	.portrait-community-category-thread--past {
		aspect-ratio: 16 / 11;
	}

	.portrait-community-category__meta {
		gap: 6px 16px;
	}
}

@media (max-width: 420px) {
	.portrait-community-masonry {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* Community thread choices stay editorial and keep the thread as the only
 * destination. This scope deliberately does not affect Home's thread list,
 * category cards, or Thread Detail. */
.portrait-community-community__intro {
	margin-bottom: 32px;
}

.portrait-community-community__intro h1 {
	font-size: clamp(2rem, 4vw, 3rem);
	line-height: 1.15;
	margin-bottom: 10px;
}

.portrait-community-community__intro p {
	font-size: 1rem;
	line-height: 1.7;
	max-width: 44rem;
}

.portrait-community-thread-list {
	display: grid;
	gap: clamp(28px, 4vw, 48px) clamp(20px, 4vw, 56px);
	grid-template-columns: repeat(2, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.portrait-community-thread-list > [role="listitem"] {
	min-width: 0;
}

.portrait-community-thread-list__item {
	align-items: start;
	display: grid;
	gap: 16px clamp(16px, 2vw, 24px);
	grid-template-columns: minmax(7rem, 12rem) minmax(0, 1fr);
	min-width: 0;
}

.portrait-community-thread-list__media {
	align-self: start;
	min-width: 0;
}

.portrait-community-thread-list__image-link {
	display: block;
	max-width: 12rem;
}

.portrait-community-thread-list__image {
	display: block;
	height: auto;
	max-width: 100%;
	width: auto;
}

.portrait-community-thread-list__image-link:focus-visible,
.portrait-community-thread-list__body a:focus-visible {
	outline: 3px solid var(--pc-color-accent, #315f73);
	outline-offset: 3px;
}

.portrait-community-thread-list__placeholder {
	color: var(--pc-color-text-supporting, #343a3d);
	font-size: 0.9375rem;
	line-height: 1.55;
	margin: 0;
}

.portrait-community-thread-list__body {
	min-width: 0;
}

.portrait-community-thread-list__latest,
.portrait-community-thread-list__category,
.portrait-community-thread-list__state,
.portrait-community-thread-list__count {
	font-size: 0.9375rem;
	line-height: 1.55;
	margin: 0;
	overflow-wrap: anywhere;
}

.portrait-community-thread-list__latest {
	color: var(--pc-color-text-supporting, #343a3d);
	font-variant-numeric: tabular-nums;
	font-weight: 500;
	margin-bottom: 10px;
}

.portrait-community-thread-list__latest time {
	overflow-wrap: anywhere;
	white-space: normal;
}

.portrait-community-thread-list__state {
	align-items: baseline;
	color: var(--pc-color-text-supporting, #343a3d);
	display: flex;
	flex-wrap: wrap;
	font-weight: 400;
	gap: 4px 12px;
	margin-top: 2px;
}

.portrait-community-thread-list__state--exception {
	color: var(--pc-color-text, #171a1c);
	font-weight: 500;
}

.portrait-community-thread-list__reposted {
	color: var(--pc-color-accent, #315f73);
	font-weight: 500;
}

.portrait-community-thread-list__body h3 {
	font-size: clamp(1.15rem, 2vw, 1.4rem);
	line-height: 1.4;
	margin: 6px 0 8px;
	overflow-wrap: anywhere;
}

.portrait-community-thread-list__body h3 a {
	color: var(--pc-color-text, #171a1c);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.15em;
}

.portrait-community-thread-list--category .portrait-community-thread-list__body h3 a {
	display: inline-block;
	min-height: 44px;
}

.portrait-community-thread-list__category {
	color: var(--pc-color-text-supporting, #343a3d);
	margin-bottom: 8px;
}

.portrait-community-thread-list__category a {
	color: var(--pc-color-accent, #315f73);
	font-weight: 500;
}

.portrait-community-thread-list__count {
	color: var(--pc-color-text-supporting, #343a3d);
	font-variant-numeric: tabular-nums;
	margin-top: 2px;
}

.portrait-community-thread-list__activity-counts {
	color: var(--pc-color-text-supporting, #343a3d);
	display: flex;
	flex-wrap: wrap;
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
	gap: 4px 14px;
	line-height: 1.55;
	margin: 2px 0 0;
}

/* Category entries reuse the Community renderer while preserving the
 * historical modifier classes used by integrations. */
.portrait-community-ui .portrait-community-thread-list__item.portrait-community-category-thread {
	aspect-ratio: auto;
	background: transparent;
	border: 0;
	border-radius: 0;
	display: grid;
	flex-direction: initial;
	overflow: visible;
}

.portrait-community-community__past {
	margin-top: clamp(52px, 8vw, 96px);
}

.portrait-community-community__category-links {
	display: grid;
	gap: 12px 24px;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.portrait-community-community__category-links a {
	align-items: baseline;
	color: var(--pc-color-text, #171a1c);
	display: flex;
	font-size: 1rem;
	font-weight: 600;
	justify-content: flex-start;
	min-height: 44px;
	padding: 8px 0;
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.18em;
}

.portrait-community-community__category-links a::after {
	color: var(--pc-color-accent, #315f73);
	content: "→";
	font-size: 1.15em;
	margin-left: 6px;
}

.portrait-community-community__category-links a:hover,
.portrait-community-community__category-links a:focus-visible {
	color: var(--pc-color-accent, #315f73);
}

.portrait-community-community__category-links a:focus-visible {
	outline: 3px solid var(--pc-color-accent, #315f73);
	outline-offset: 3px;
}

.portrait-community-community__past .portrait-community-thread-list__item {
	opacity: 0.95;
}

@media (max-width: 720px) {
	.portrait-community-thread-list {
		grid-template-columns: minmax(0, 1fr);
	}

	.portrait-community-community__category-links {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.portrait-community-thread-list__item {
		display: block;
	}

	.portrait-community-thread-list__image-link {
		max-width: min(15rem, 100%);
	}

	.portrait-community-thread-list__media {
		margin-bottom: 12px;
	}

	.portrait-community-thread-list__item--no-image .portrait-community-thread-list__media {
		margin-bottom: 4px;
	}

	.portrait-community-community__category-links {
		grid-template-columns: minmax(0, 1fr);
	}
}
