/*
 * Event template: the single event or news post.
 *
 * Unlike the one-pager, this page does NOT scale. The one-pager is a 1500x915
 * canvas measured in a unit that grows and shrinks with the window; this is an
 * ordinary fixed layout - a full-width black hero and a full-width white band,
 * with a 1200 container down the middle of both and type that stays the size
 * it is typed at. The numbers below are Figma's own, read off the same 1500x915
 * frames, but they are pixels here rather than canvas units.
 *
 * It still loads hdci-sections.css, for the header lockup it reuses and for
 * the base type. The few places where that stylesheet would have grown
 * something past the comp are overridden under .evtop.
 */

.site-main--event {
	margin: 0;
	max-width: none;
}

/*
 * The container. 1280 less 40 either side is the comp's 1200 column. The black
 * and the white are full width; only what sits on them is held to this.
 */
.con-12 {
	/*
	 * The gutter is a variable because the hero's contents are positioned
	 * absolutely against this box, and an absolutely positioned child is
	 * placed against the PADDING box - it does not inherit the padding. They
	 * inset themselves by this instead, so the gutter is still written once.
	 */
	--gutter: 40px;

	width: 100%;
	max-width: 1280px;
	padding: 0 var(--gutter);
	margin: 0 auto;
}

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

.evtop {
	position: relative;
	height: 100vh;
	overflow: hidden;
	background: #000;
}

/*
 * Everything in the hero is placed against the container, so left: 0 below
 * means the column's edge and not the window's.
 */
.evtop__stage {
	position: relative;
	height: 100%;
}

/*
 * The header lockup comes from hdci-sections.css, where it is positioned
 * against the window and sized in canvas units because the one-pager's grows.
 * Here it is inside the container and does not grow, so its sizes are pinned
 * to the comp's own.
 */
.evtop .top__header {
	top: 65px;
	left: var(--gutter);
	right: var(--gutter);
}

.evtop .top__logo {
	width: 177px;
}

.evtop .top__give {
	padding: 8px 14px;
	font-size: 14px;
}

.evtop .top__menu {
	width: 36px;
	height: 36px;
}

.evtop .top__menu img {
	width: 19px;
}

/*
 * The headline and the meta row below it are one column. Figma places them at
 * 175.77 and 649.5 as if they were independent, which holds only while the
 * headline fits in the five lines the comp draws; a press release headline can
 * run to ten, and placed that way it would be printed straight through the
 * date and the place.
 *
 * So the gap is a minimum height on the headline rather than a position on the
 * meta: 414 plus the 60 below it puts the meta at 649.5 whenever the headline
 * is shorter than that, and moves it down by the overflow when it is not. The
 * date and the place end up below the headline whatever its length, and on the
 * comp's line whenever they can be.
 */
.evtop__col {
	position: absolute;
	top: 176px;
	left: var(--gutter);
	right: var(--gutter);
}

.evtop__headline {
	width: 431px;
	max-width: 100%;
	min-height: 414px; /* 649.5 - 175.77 - 60 */
	margin: 0 0 60px;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 45px;
	font-weight: 600;
	line-height: 50px;
	color: #fff;
}

/*
 * The comp's 431 is drawn on a 1500 canvas, where the column is already
 * narrower than this page's is on a desktop window. Once the container has
 * finished growing there is room for the headline to be wider, and a press
 * release headline wants it: 500 is the width above 1200.
 */
@media (min-width: 1200px) {
	.evtop__headline {
		width: 500px;
	}
}

/*
 * Held by its right edge: the comp keeps that edge at the column's edge in
 * both frames, so anchoring there means the scrub only has to change the size
 * and the edge it lines up against cannot drift.
 *
 * The width is a maximum rather than a fixed figure. Between the breakpoint
 * and about 1280 the container is narrower than the comp's, and 598 of photo
 * beside 431 of headline does not fit in it; capping both at a share of the
 * column lets them shrink together instead of colliding. hdci-event.js reads
 * the width back rather than assuming 598, so the scrub shrinks whatever is
 * actually there by the comp's proportion.
 */
.evtop__photo {
	position: absolute;
	top: 182px;
	right: var(--gutter);
	width: min(598px, 50%);
	aspect-ratio: 598 / 398;
	margin: 0;
	border-radius: 5px;
	overflow: hidden;
	opacity: 0.9;
}

.evtop__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.evtop__photo-wash {
	position: absolute;
	inset: 0;
	background: #000;
	opacity: 0; /* The scrub takes it to the comp's 0.6. */
}

/*
 * Date on the left, place on the right. The comp starts them at 149.95 and
 * 750.95 against a 1200 column, which is the container's left edge and its
 * middle.
 */
.evtop__meta {
	display: grid;
	grid-template-columns: 50% 1fr;
}

.evtop__meta-block {
	--meta-value: 271px;

	position: relative;
	display: grid;
	grid-template-columns: var(--meta-value) 1fr;
	padding-top: 34px;
}

.evtop__meta-block--place {
	--meta-value: 228px;
}

/*
 * The rule is 550 wide and the column is wider, so it is drawn rather than
 * borrowed from the block's own border.
 */
.evtop__meta-block::before {
	content: "";
	position: absolute;
	top: 0;
	left: 0;
	width: 550px;
	max-width: 100%;
	height: 1px;
	background: #fff;
	opacity: 0.5;
}

.evtop__meta-label,
.evtop__meta-value {
	margin: 0;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 18px;
	font-weight: 400;
	line-height: 24px;
}

.evtop__meta-label {
	color: #6f7072;
}

/*
 * pre-line because the lines come from PHP as a single string: the date and
 * the time range, or the venue, the address and the room. They are one field
 * each in the comp too - a stack of lines, not a list.
 */
.evtop__meta-value {
	white-space: pre-line;
	color: #fff;
}

/* The Description band ---------------------------------------------------
 *
 * Starts 88 above the bottom of the screen and rises until its top is at the
 * top of it, by being scrolled rather than animated. The negative margin is the
 * whole of it: the hero above is pinned, so until the pin ends the only thing
 * the scroll can move is this. 428 - the comp's second frame - is a point it
 * passes on the way, and the one the hero's own scrub is timed to.
 */

.evbody {
	position: relative;
	z-index: 1;
	margin-top: -88px;

	/*
	 * A screenful at least, because the band has to be able to cover the hero
	 * completely: the pin lasts until the band's top reaches the top of the
	 * window, and a band shorter than the window would leave the pinned hero
	 * showing under its bottom edge. It is also what the page can scroll by
	 * while the hero is pinned, so the pin's distance in hdci-event.js and
	 * this are the same number read two ways.
	 */
	min-height: 100vh;

	display: flex;
	flex-direction: column;
	background: #fff;
}

/*
 * When the content does not reach that screenful - a short post, or simply a
 * tall window - the slack goes ABOVE the footer rather than below it, so the
 * lockup sits at the foot of the page the way the one-pager's does instead of
 * floating in the middle of a white field. .evfoot's own 79 top is the
 * minimum; margin-top: auto only ever adds to it.
 */
.evbody__inner {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
}

.evfoot {
	margin-top: auto;
}

.evbody__inner {
	will-change: transform;
}

/*
 * 63 from the top of the band, which is where the comp has it at the END of
 * the scrub; at the start it is 36.5 higher. That difference is a parallax the
 * scrub plays on .evbody__inner, so the resting value is the one typed here -
 * the page is correct with the JS gone, and correct again once the pin has
 * released.
 */
.evbody__title {
	margin: 0;
	padding-top: 63px;
	padding-bottom: 28px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.25);
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 30px;
	font-weight: 600;
	line-height: 32px;
	color: #000;
}

.evbody__copy {
	margin-top: 28px;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #000;
}

.evbody__copy p {
	margin: 0 0 1.5em;
}

.evbody__copy > :last-child {
	margin-bottom: 0;
}

.evbody__copy h2,
.evbody__copy h3,
.evbody__copy h4 {
	margin: 2em 0 0.5em;
	font-size: 18px;
	font-weight: 700;
	line-height: 24px;
}

.evbody__copy img {
	max-width: 100%;
	height: auto;
	border-radius: 5px;
}

/*
 * Every link on this page is one colour and nothing else, in every state, the
 * way the one-pager's are: no underline, no hover, no visited. The selector
 * names the states explicitly rather than relying on the bare one, because the
 * browser's own :visited and :link rules are more specific than a plain `a`
 * and would otherwise win.
 */
.evbody__copy a,
.evbody__copy a:link,
.evbody__copy a:visited,
.evbody__copy a:hover,
.evbody__copy a:focus,
.evbody__copy a:active,
.evrow__title a,
.evrow__title a:link,
.evrow__title a:visited,
.evrow__title a:hover,
.evrow__title a:focus,
.evrow__title a:active {
	color: #000;
	text-decoration: none;
}

.evbody__back,
.evbody__back:link,
.evbody__back:visited,
.evbody__back:hover,
.evbody__back:focus,
.evbody__back:active,
.evrow__more,
.evrow__more:link,
.evrow__more:visited,
.evrow__more:hover,
.evrow__more:focus,
.evrow__more:active {
	color: #3fb3fa;
	text-decoration: none;
}

.evfoot__social a,
.evfoot__social a:link,
.evfoot__social a:visited,
.evfoot__social a:hover,
.evfoot__social a:focus,
.evfoot__social a:active {
	color: #000;
	text-decoration: none;
}

.evbody__back,
.evrow__more {
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	text-transform: uppercase;
}

.evbody__back {
	display: block;
	margin-top: 31px;
	text-align: center;
}

/* The next event ---------------------------------------------------------
 *
 * Figma's third frame, which is this same page scrolled on: the band has
 * reached the top of the screen and a row sits under the description. The comp
 * draws one, and there is one - the next event in the calendar. The gap above
 * it is the 25.5 the comp leaves between the end of the copy and the hairline.
 */

.evbody__next {
	margin-top: 33px;
}

/*
 * Date, photo, headline, Learn More. The first two are fixed because the comp
 * fixes them; the headline is a maximum so that it can give width back when
 * there is not enough, and the last is a fraction only so that it takes up
 * whatever is left over - what matters is where it STARTS, which is 25 past
 * the headline's area and nowhere else.
 */
.evrow {
	display: grid;
	grid-template-columns: 271px 364px minmax(0, 440px) 1fr;
	min-height: 206px;
	border-top: 1px solid rgba(0, 0, 0, 0.25);
	border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

.evrow__date {
	margin: 0;
	padding-top: 31px;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 14px;
	line-height: 1.5;
	color: #000;
}

.evrow__photo {
	width: 210px;
	aspect-ratio: 210 / 139.71;
	margin-top: 33px;
	border-radius: 5px;
	overflow: hidden;
}

.evrow__photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * No padding on the right: the 440 track IS the headline's area, and the gap
 * to Learn More is that control's own left padding rather than a share of
 * this one's width.
 */
.evrow__title {
	margin: 0;
	padding-top: 25px;
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 24px;
	font-weight: 600;
	line-height: 32px;
}

/*
 * Aligned to the start of its track rather than the end of it. Right aligned
 * it sat against the container's edge, so the distance from the headline was
 * whatever the window happened to leave - a hand's breadth at 1500 and most
 * of a column at 992. From the start of the track it is 25 from the headline
 * at every width, which is where the comp has it at 1500 anyway.
 */
.evrow__more {
	padding-top: 30px;
	padding-left: 25px;
	text-align: left;
	white-space: nowrap;
}

/*
 * The last of the wide layout. The comp's four tracks come to 1200 exactly,
 * so the moment the container stops being 1200 - which is 1280, where it
 * stops growing - there is no longer room for the comp's date and photo
 * columns AND a full headline. The headline is the part worth keeping: the
 * other two are a short line of type and a 210 picture sitting in tracks that
 * are mostly air, so the air comes out of them first. 150 still holds
 * "November 17, 2026" on one line and 234 still holds the photo with its
 * gutter.
 *
 * The seam is at 1280 rather than lower because that is where the page itself
 * changes character: above it the composition is the comp's, below it the
 * column is being rationed.
 */
@media (max-width: 1279px) and (min-width: 992px) {
	.evrow {
		grid-template-columns: 150px 234px minmax(0, 440px) 1fr;
	}
}

/* The footer -------------------------------------------------------------
 *
 * The one-pager's lockup drawn black on white.
 */

.evfoot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 24px;

	/*
	 * 67 below rather than the comp's 58, to match the one-pager: measured
	 * there, the footer lockup rests 67 above the bottom of the window at the
	 * canvas's own 915 height. That page's figure grows with the window and
	 * this one's does not, so what is matched is the number at 915 rather
	 * than the rule that produces it.
	 */
	padding: 79px 0 67px;
}

.evfoot__logo {
	display: block;
	width: 177px;
	flex: 0 0 auto;

	/*
	 * The mark is white artwork. On this page it has a white page behind it,
	 * so it is inverted to black rather than being shipped twice.
	 */
	filter: invert(1);
}

.evfoot__logo img {
	display: block;
	width: 100%;
	height: auto;
}

/*
 * The one-pager's address drawn black on white. Figma has it 57.95 from the
 * logo; .evfoot already sets a 24 gap between its items, so the margin here
 * is the remainder rather than the whole offset.
 *
 * Inter Bold 12 in the comp is Figma's default, not a choice - set in the
 * body face at body size, matching .evbody__copy. See the one-pager's copy.
 */
.evfoot__address {
	margin: 0 auto 0 34px; /* 57.95 - the row's own 24 gap */
	font-family: "IBM Plex Sans", sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.25;
	color: #000;
}

.evfoot__right {
	display: flex;
	align-items: center;
	gap: 28px;
}

.evfoot__social {
	display: flex;
	align-items: center;
	gap: 28px; /* 50 - 22 */
	margin: 0;
	padding: 0;
	list-style: none;
}

.evfoot__social a {
	display: block;
	font-size: 22px;
	line-height: 1;
}

/*
 * The one-pager's back-to-top control with its two colours exchanged: there
 * the disc is white on a black stage, here it is black on a white page. The
 * artwork is the same black arrow either way, so on this one it is the GLYPH
 * that inverts rather than the disc.
 */
.evfoot__top {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #000;
	cursor: pointer;
	line-height: 0;
}

.evfoot__top img {
	display: block;
	height: 19px; /* 19.4 in the comp's 37px disc, at the 36 above */
	width: auto;
	filter: invert(1);
}

/* Narrow ------------------------------------------------------------------
 *
 * 992, not the one-pager's 1024. The two pages are built differently and give
 * out at different widths: the one-pager's composition stops reading when its
 * outer thirds get narrow, and this one stops when the headline and the photo
 * can no longer sit side by side.
 *
 * There is no narrow frame for this template in Figma. What is below is the
 * same composition unstacked rather than a second design: the hero stops being
 * a placed composition and becomes a stack, the meta's two blocks become one
 * column, and the row's four become a photo with the copy beside it. It should
 * be checked against a comp when there is one.
 *
 * TODO: the container may want a max-width here - 600 or so - to skip tablet
 * and go straight to the phone layout, as on other Copperwing sites. Not
 * settled, so it is left full width for now.
 */

@media (max-width: 991px) {
	.con-12 {
		--gutter: 25px;
	}

	.evtop {
		height: auto;
	}

	/*
	 * Only the vertical padding is set here. The horizontal is the container's
	 * own gutter, and a shorthand would have quietly thrown it away.
	 */
	.evtop__stage {
		display: flex;
		flex-direction: column;
		height: auto;
		padding-top: 150px;
		padding-bottom: 48px;
	}

	.evtop .top__header {
		top: 24px;
		left: var(--gutter);
		right: var(--gutter);
	}

	/*
	 * display: contents so the headline and the meta row become children of
	 * the stack in their own right. They are one element on the desktop
	 * because the meta has to be pushed down by a long headline; stacked,
	 * they are simply two of the four things in the column, and the photo
	 * needs to be able to sit between them.
	 */
	.evtop__col {
		display: contents;
	}

	.evtop__photo {
		position: static;
		width: auto;
	}

	.evtop__headline {
		order: 1;
		width: auto;
		min-height: 0;
		margin-bottom: 0;
		font-size: 32px;
		line-height: 36px;
	}

	/*
	 * The photo is written before the headline so that the placed composition
	 * can sit it on the right; stacked, it belongs under the headline, which
	 * is one line of order rather than a second block of markup.
	 */
	/*
	 * Capped rather than left to fill the column: at 991 a full-width photo at
	 * the comp's proportion is 660 tall, which is most of a tablet screen
	 * before the headline above it. 600 is the width the container may end up
	 * capped at here anyway - see the note above.
	 */
	.evtop__photo {
		order: 2;
		width: 100%;
		max-width: 600px;
		margin-top: 32px;
	}

	.evtop__meta {
		order: 3;
		margin-top: 40px;
		grid-template-columns: 1fr;
		gap: 24px;
	}

	.evtop__meta-block {
		--meta-value: 110px;

		padding-top: 16px;
	}

	.evtop__meta-block::before {
		width: 100%;
	}

	.evtop__meta-label,
	.evtop__meta-value {
		font-size: 16px;
		line-height: 22px;
	}

	/*
	 * No pin here, so no negative margin either: the band follows the hero
	 * rather than starting on top of it. These rules and the media query in
	 * hdci-event.js have to agree about 992, or the page either overlaps
	 * itself or leaves a screen of black under the scrub.
	 */
	.evbody {
		margin-top: 0;
		min-height: 0;
	}

	.evbody__title {
		padding-top: 40px;
		font-size: 26px;
		line-height: 30px;
	}

	.evbody__copy,
	.evrow__date {
		font-size: 15px;
	}

	.evbody__next {
		margin-top: 24px;
	}

	/*
	 * Three rows: the date across the top, then the photo down the left with
	 * the headline and Learn More stacked beside it.
	 *
	 * Every row is placed explicitly and the photo spans the two it sits
	 * against. Left to auto-placement the headline landed in a row the PHOTO
	 * sized, so when the photo was the taller of the two - which it is
	 * whenever the headline runs to a couple of lines - Learn More began
	 * below the bottom of the picture rather than below the bottom of the
	 * headline, and the distance between them was whatever that difference
	 * happened to be. Spanning the photo takes it out of the headline's row,
	 * so the gap is Learn More's own padding and nothing else.
	 */
	.evrow {
		grid-template-columns: 120px 1fr;

		/*
		 * A fourth row, with nothing in it, that the photo also spans. When
		 * the picture is taller than the headline and Learn More together a
		 * spanning item grows the rows it covers, and without somewhere to
		 * put that growth a share of it lands between the two - which is the
		 * gap this layout is trying not to have. The empty row takes it.
		 */
		grid-template-rows: auto auto auto 1fr;
		gap: 0 16px;
		min-height: 0;
		padding: 20px 0;
	}

	.evrow__date {
		grid-row: 1;
		grid-column: 1 / -1;
		padding-top: 0;
		padding-bottom: 10px;
	}

	.evrow__photo {
		grid-row: 2 / -1;
		grid-column: 1;
		align-self: start;
		width: 100%;
		margin-top: 0;
	}

	.evrow__title {
		grid-row: 2;
		grid-column: 2;
		align-self: start;
		padding-top: 0;
		font-size: 20px;
		line-height: 26px;
	}

	.evrow__more {
		grid-row: 3;
		grid-column: 2;
		align-self: start;
		padding-top: 10px;
		padding-left: 0;
		text-align: left;
	}

	.evfoot {
		flex-wrap: wrap;
		padding: 40px 0 32px;
	}

	/* On its own line under the row, as on the one-pager. See there. */
	.evfoot__address {
		order: 1;
		width: 100%;
		margin: 16px 0 0;
	}
}

/*
 * No pin, no scrub: hdci-event.js stops before it creates either, so the band
 * simply scrolls up over a hero that never changes. The resting values are the
 * ones in this stylesheet, so there is nothing to undo.
 */
@media (prefers-reduced-motion: reduce) {
	.evbody__inner {
		will-change: auto;
	}
}
