/*
General
 */

/*
Page Content
 */
.PageContentInner {
	margin-inline:                 auto;
	max-width:                     calc(var(--ReadableContent-MaxWidth) + 2 * var(--Viewport-InlinePadding));
	padding-inline:                var(--Viewport-InlinePadding);
}

/* Overview / Share Challenge headings — Display cut, not the Text cut Base.css's
   generic h1-h6 rule defaults every heading to. */
.PageContentInner h2 {
	font-family:                   var(--Typeface02-FontFamily);
	font-size:                     24px;
	font-variation-settings:       var(--Typeface02-FontVariationSettings);
	line-height:                   24px;
	margin:                        0;
}

/*
Actions Row — back arrow and the Menu component, both .FEIconButton (Base.css). The
negative margin-inline pulls the 40px hit areas back so the 24px icons themselves line
up with the gutter, matching the correction .NavigationList already makes.
 */
.ChallengeActionsArea {
	align-items:                   center;
	display:                       flex;
	justify-content:               space-between;
	margin-bottom:                 24px;
	margin-inline:                 -8px;
}

.ChallengeBackButtonIcon {
	background-color:              currentColor;
	mask:                          url("/Images/IconBackArrow.svg") no-repeat center / contain;
}

/*
Heading
 */
.ChallengeHeadingArea {
	margin-bottom:                 16px;
}

.ChallengeTitle {
	font-family:                   var(--Typeface02-FontFamily);
	font-size:                     32px;
	font-variation-settings:       var(--Typeface02-FontVariationSettings);
	line-height:                   32px;
	margin-bottom:                 4px;
}

.ChallengeCreatedBy {
	color:                         #CCD5E2;
	font-size:                     14px;
	font-weight:                   500;
	line-height:                   18px;
	margin:                        0;
}

/*
Thumbnail

Raster override exported from Sketch at 1280x705 (2x of the 640px max content width) as
WebP — see LocalTemp/ChallengeAndCampaignDetailPlan.md §6.8. The 24px corner radius is
already baked into the file's alpha; border-radius is still set here so the shape
survives a future re-export without corners.
 */
.ChallengeThumbnailArea {
	margin-bottom:                 16px;
}

.ChallengeThumbnail {
	aspect-ratio:                  327 / 180;
	border-radius:                 24px;
	display:                       block;
	height:                        auto;
	object-fit:                    cover;
	width:                         100%;
}

/*
Join Challenge — Active only. The button sits 27px under the dates where the results band
sits 24px under them, hence the extra 3px here (padding, since a margin would collapse
into the status area's).
 */
.ChallengeJoinArea {
	margin-bottom:                 23px;
	padding-top:                   3px;
}

/* In place of Join Challenge until the challenge starts; placeholder copy for the PM, worded
   like the campaign page's not-open notice. */
.ChallengeJoinNotice {
	font-size:                     16px;
	line-height:                   24px;
	margin:                        0;
	text-align:                    center;
}

/*
Results Band — Closed only, in place of Join Challenge. Each close type sets the theme
colour, which fades from 80% to nothing down the band (Sketch: Challenges - Detail
(Challenge Ended - …)). The subtitle takes the theme colour only when there is a winner.

The band shares .PageContentInner's width. Below that width it runs edge to edge, as in
the design; once the viewport is at least that wide, a mask fades the band out over its
24px inline padding, so it has no hard edge where it stops. 688px is the max-width below
(640 + 2 × 24); a media query can't read the custom properties.
 */
.ChallengeResult {
	--ChallengeResultTheme-Color:  var(--Colors-Brand-Primary);

	background-image:              linear-gradient(color-mix(in srgb, var(--ChallengeResultTheme-Color) 80%, transparent), transparent);
	margin-bottom:                 40px;
	margin-inline:                 auto;
	max-width:                     calc(var(--ReadableContent-MaxWidth) + 2 * var(--Viewport-InlinePadding));
	padding:                       24px var(--Viewport-InlinePadding);
	text-align:                    center;
}

@media (min-width: 688px) {
	.ChallengeResult {
		mask-image:                    linear-gradient(to right, transparent, #000000 var(--Viewport-InlinePadding), #000000 calc(100% - var(--Viewport-InlinePadding)), transparent);
	}
}

.ChallengeResultResolved {
	--ChallengeResultTheme-Color:  var(--Colors-Secondary-Accent01);
}

.ChallengeResultResolved[data-winning-side="2.00"] {
	--ChallengeResultTheme-Color:  var(--Colors-Secondary-Accent03);
}

.ChallengeResultCancelled {
	--ChallengeResultTheme-Color:  #EE0B0B;
}

.ChallengeResultTitle {
	--Typeface-FontWght:           800;

	font-family:                   var(--Typeface02-FontFamily);
	font-size:                     48px;
	font-variation-settings:       var(--Typeface02-FontVariationSettings);
	line-height:                   42px;
	margin-bottom:                 8px;
}

.ChallengeResultText {
	font-size:                     16px;
	line-height:                   24px;
	margin:                        0;
}

.ChallengeResultResolved .ChallengeResultText {
	color:                         var(--ChallengeResultTheme-Color);
}

.ChallengeResultSideName {
	--Typeface-FontWght:           700;

	font-weight:                   var(--Typeface-FontWght);
}

.ChallengeJoinButton {
	width:                         100%;
}

/*
Description Area
 */
.ChallengeDescriptionArea {
	font-size:                     16px;
	line-height:                   24px;
	margin-bottom:                 24px;
}

.ChallengeDescriptionArea h2 {
	margin-bottom:                 8px;
}

/*
Organization Information
 */
.ChallengeOrganizationInformation {
	display:                       flex;
	gap:                           16px;
}

.ChallengeOrganizationInformation .OrganizationImageArea {
	flex:                          0 0 148px;
}

.ChallengeOrganizationInformation .OrganizationImage {
	aspect-ratio:                  148 / 81;
	border-radius:                 12px;
	display:                       block;
	object-fit:                    cover;
	width:                         100%;
}

.ChallengeOrganizationInformation .OrganizationContentArea {
	font-size:                     14px;
	line-height:                   18px;
	padding:                       7px 0 5px;
}

.ChallengeOrganizationInformation .OrganizationTitle {
	--Typeface-FontWght:           700;

	font-weight:                   var(--Typeface-FontWght);
}

/*
Share Challenge
 */
.ChallengeShareArea {
	margin-top:                    40px;
}

.ChallengeShareArea h2 {
	margin-bottom:                 24px;
}

.ChallengeShareLinkButton {
	width:                         100%;
}

/*
Social Row — Facebook and X open a share intent for this page.
 */
.ChallengeSocialArea {
	display:                       flex;
	gap:                           40px;
	justify-content:               center;
	margin-top:                    40px;
}

.ChallengeSocialLink {
	border-radius:                 100%;
	color:                         #ffffff;
	display:                       block;
	transition:                    var(--InteractiveTransitionDuration);
}

.ChallengeSocialLink:hover,
.ChallengeSocialLink:focus-visible {
	color:                         var(--Colors-Brand-Primary);
	outline:                       none;
}

/* Icon-only social buttons don't want the external-link marker Base.css appends. */
.ChallengeSocialLink[target="_blank"]::after {
	display:                       none;
}

.ChallengeSocialIcon {
	display:                       block;
	height:                        42px;
	width:                         42px;
}

.ChallengeSocialIcon.IconFacebook {
	background-color:              currentColor;
	mask:                          url("/Images/IconFacebook.svg") no-repeat center / contain;
}

.ChallengeSocialIcon.IconX {
	background-color:              currentColor;
	mask:                          url("/Images/IconX.svg") no-repeat center / contain;
}
