/* ==========================================================================
   "Dates for the diary" home-page ticker  -  NEW FILE (does not touch main.css)
   Goes in: /site/templates/css/ticker.css

   The band sits in normal document flow, immediately AFTER the home hero
   (not over the image). It fills the leftover viewport below the original
   hero so the first screen is: header + hero image + ticker only.
   Body text is revealed by scrolling. The band is not hidden or collapsed
   on scroll (that would shift layout and break menu/sidebar landings).
   ========================================================================== */

.diary-ticker {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 22px;
	box-sizing: border-box;
	width: 100%;
	margin: 0;
	padding: 16px 40px;
	background: #e8f4fa;                 /* light tint of SENS --blue #0083c3 */
	color: #24619f;                      /* --logoblue */
	border-top: 3px solid #0083c3;
	border-bottom: 1px solid #c5e0ef;
}

.diary-ticker[hidden] {
	display: none;
}

.diary-ticker__label {
	flex: 0 1 auto;
	font-size: 1.105rem;             /* ~17.7px: 15% smaller than 1.3rem / 20.8px */
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #0083c3;
	padding-right: 22px;
	border-right: 1px solid #8cc5e0;
	white-space: normal;             /* longer label may wrap; font size unchanged */
	line-height: 1.35;
}
.diary-ticker__label a {
	color: inherit;
	font-weight: inherit;
	letter-spacing: inherit;
	text-transform: inherit;
	text-decoration: underline;
	text-underline-offset: 0.18em;
}
.diary-ticker__label a:hover,
.diary-ticker__label a:focus {
	color: #24619f;
}

/* Items sit on top of each other and fade in / out */
.diary-ticker__list {
	position: relative;
	flex: 1 1 auto;
	max-width: 1100px;
	margin: 0;
	padding: 0;
	list-style: none;
	height: 1.3em;
	font-size: 1.7rem;                  /* ~27.2px: 15% smaller than 2rem / 32px */
	line-height: 1.3;
}
.diary-ticker__list li,
.diary-ticker__list a {
	font-size: inherit; /* beat main.css `li { font-size: 1.1rem }` */
	line-height: 1.3;
}
.diary-ticker__list li {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	opacity: 0;
	visibility: hidden;
	transition: opacity 1.4s ease, visibility 0s linear 1.4s;
}
.diary-ticker__list li.is-active {
	opacity: 1;
	visibility: visible;
	transition: opacity 1.4s ease, visibility 0s;
}
.diary-ticker__list a {
	display: block;
	color: #24619f;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.diary-ticker__list a:hover,
.diary-ticker__list a:focus {
	color: #0083c3;
	text-decoration: underline;
}
.diary-ticker__date {
	font-weight: 700;
	color: #0083c3;
}

@media (prefers-reduced-motion: reduce) {
	.diary-ticker__list li,
	.diary-ticker__list li.is-active { transition: none; }
}

/* ----- Desktop / tablet: hero is 85vh, so the band fills the remaining 15vh.
   1920x1072 first screen: 15vh = 161px. min-height is a floor for short
   windows; no max-height, so the band always meets the fold.            */
@media only screen and (min-width: 600px) {
	body.home .diary-ticker {
		height: 15vh;
		height: 15svh;
		min-height: 88px;              /* floor for the 32px item on short desktops */
		/* Align the label+item with the site header / content inner (1420px). */
		justify-content: flex-start;
		padding-left: max(40px, calc((100% - 1420px) / 2 + 30px));
		padding-right: max(40px, calc((100% - 1420px) / 2 + 30px));
	}
	.diary-ticker__list {
		max-width: none;  /* fill the remaining inner width; items are position:absolute so the list must have a width */
	}
}

/* ----- Phones: hero is a fixed 520px (including the 92px header stripe).
   Band height = leftover viewport. Content is vertically centred.
   Text wraps onto two lines instead of truncating.                      */
@media only screen and (max-width: 599px) {
	body.home .diary-ticker {
		flex-direction: column;
		align-items: center;
		justify-content: center;
		gap: 8px;
		padding: 16px 20px;
		height: calc(100vh - 520px);
		height: calc(100svh - 520px);
		min-height: 140px;             /* label + up to three wrapped 25.6px lines */
		text-align: center;
	}
	.diary-ticker__label {
		padding: 0;
		border: 0;
		font-size: 0.8925rem;          /* ~14.3px: 15% smaller than 1.05rem / 16.8px */
		max-width: 100%;
	}
	.diary-ticker__list {
		flex: 0 0 auto;                 /* don't stretch; keep the group vertically centred */
		width: 100%;
		height: 3.9em;                  /* room for three wrapped lines */
		font-size: 1.36rem;             /* ~21.8px: 15% smaller than 1.6rem / 25.6px */
		line-height: 1.3;
	}
	.diary-ticker__date {
		display: block;                 /* date on its own line, then the event */
	}
	.diary-ticker__sep {
		display: none;                  /* don't start the event line with a leftover · */
	}
	.diary-ticker__list a {
		white-space: normal;             /* wrap, do not ellipsize */
		overflow: visible;
		text-overflow: unset;
	}
}

/* Our Partners: group the remaining logos in the centre (home page only).
   On phones the existing one-logo-per-row stack is left as it is. */
@media only screen and (min-width: 600px) {
	body.home .logo-list {
		justify-content: center;
		gap: 28px 56px;
	}
	body.home .logo-list .client-logo {
		flex: 0 1 auto;
	}
}

/* Our Partners: ADM logo ~50% larger, bottom-aligned so it can rise above the others (home page only). */
body.home .logo-list {
	align-items: flex-end;
}
body.home .logo-list .client-logo {
	display: flex;
	align-items: flex-end;
}
body.home .logo-list img[src*="adm-logo"] {
	max-height: 83px; /* was 55px; ~50% larger */
	height: auto;
	width: auto;
}
