/* File: /themes/speeches/parts/devotional-banner/devotional-banner.css */

/* ===========================================
   Devotional Banner Component

   Pixel-exact port of the live-site devotional hero
   (pg-core-child: template-parts/devotional-banner.php + src/css/home.css).
   Values mirror that file; only the tokens are localized to this theme.

   Full-bleed image with the darkening baked in (no CSS gradient), content in a
   centered 7-row grid, and a blue undertext. Mobile-first:
   overrides at 640px (--bp-small-tablet-640) and 1200px (--bp-desktop-1200),
   matching the original's breakpoints.
   =========================================== */

.devotional-banner {
	width: 100%;
	position: relative;
	overflow: hidden;
	color: var(--c-white);
}

/* Hero Section - height is content-driven; the image sits behind it. */
.devotional-banner__hero {
	position: relative;
	width: 100%;
	display: flex;
	flex-direction: column;
	overflow: hidden;

	/* All banner text is white and the original applies no gradient (the
	   darkening is baked into the image), so with no image behind it the
	   content would be white-on-white and unreadable. This is covered
	   completely once the image paints; it only shows while a large hero
	   image is still decoding, or when the image 404s / the ACF gallery is
	   empty. A deliberate divergence from pg-core-child, which has none. */
	background-color: var(--c-navy-byu);
}

/* Background Image (full-bleed cover, slow ambient zoom) */
.devotional-banner__background {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 0;
	overflow: hidden;
	animation: devotionalBannerSoftZoom 60s ease-in-out infinite;
}

.devotional-banner__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
}

@keyframes devotionalBannerSoftZoom {

	0%,
	100% {
		transform: scale(1);
	}

	50% {
		transform: scale(1.15);
	}
}

/* A 60s infinite transform is exactly what this query exists for. */
@media (prefers-reduced-motion: reduce) {

	.devotional-banner__background {
		animation: none;
	}
}

/* Content Container - centered 3-column grid.
   Rows are assigned explicitly on every child because each one is conditionally
   rendered; auto-placement would shift the stack when a portrait or speaker
   position is missing.

   The centre track is floored at 0 rather than left as a bare max-content: a
   bare max-content track sizes to the widest single line any child wants and
   will happily exceed the container, which collapses both 1fr side tracks to
   zero and leaves every justify-self: center child centred on the oversized
   TRACK rather than on the banner - shoved right and clipped by the section's
   overflow: hidden. The 0 floor lets the track shrink to the space available,
   so an over-long child wraps instead of dragging the whole stack sideways. */
.devotional-banner__content {
	position: relative;
	z-index: 3;
	display: grid;
	grid-template-columns: 1fr minmax(0, max-content) 1fr;
	grid-template-rows: repeat(7, auto);
}

/* Supertext - "BYU Speeches: By Study & By Faith" */
.devotional-banner__supertext {
	grid-column: 2/3;
	grid-row: 1/2;
	justify-self: center;
	font-family: var(--f-ibm-plex-sans);
	font-size: 10px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 1.1px;
	opacity: 0.5;
	margin: 22px 0 0;
}

/* Meta row: tag pill + date/time/location.
   Stacked on mobile, inline from 640px. */
.devotional-banner__meta {
	grid-column: 2/3;
	grid-row: 2/3;
	justify-self: center;
	display: flex;
	flex-direction: column;
	align-items: center;
	margin: 2.75rem 0 0;
}

.devotional-banner__tag {
	font-family: var(--f-ibm-plex-sans);
	font-size: 10px;
	text-transform: uppercase;
	letter-spacing: 1px;
	background-color: transparent;
	border: 1px solid var(--c-white);
	border-radius: var(--brad-button-medium);
	padding: 0.375rem 1rem;
	white-space: nowrap;
}

.devotional-banner__meta-text {
	font-family: var(--f-source-serif-pro);
	font-size: 15px;
	font-style: italic;
	font-weight: 300;
	color: var(--c-white);
	letter-spacing: 0.5px;
	margin-top: 0.75rem;
}

/* Speaker portrait - circular, above the name (moves left of it at 1200px). */
.devotional-banner__portrait {
	grid-column: 2/3;
	grid-row: 3/4;
	justify-self: center;
	align-self: center;
	position: relative;
	margin: 14px 0 0;
}

.devotional-banner__portrait-image {
	display: block;
	width: 100px;
	height: 100px;
	border-radius: var(--brad-circle);
	object-fit: cover;
	object-position: top;
	overflow: hidden;
}

/* Main Heading - speaker name */
.devotional-banner__heading {
	grid-column: 2/3;
	grid-row: 4/5;
	justify-self: center;
	z-index: 3;
	max-width: 325px;
	font-family: var(--f-ibm-plex-sans);
	font-size: 41px;
	font-weight: 400;
	line-height: 1;
	text-align: center;
	padding: 0 1rem;
	margin: 0;
}

/* Subheading - speaker position */
.devotional-banner__subheading {
	grid-column: 2/3;
	grid-row: 5/6;
	justify-self: center;
	z-index: 3;
	width: 300px;
	font-family: var(--f-ibm-plex-sans);
	font-size: 10px;
	font-weight: 400;
	text-transform: uppercase;
	letter-spacing: 3px;
	line-height: 2;
	text-align: center;
	margin: 0.5rem;
}

/* Watch button - visual only (aria-hidden);
   the real link is the overlay below. */
.devotional-banner__button {
	grid-column: 2/3;
	grid-row: 6/7;
	justify-self: center;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-family: var(--f-ibm-plex-sans);
	font-size: 13px;
	font-weight: 700;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	padding: 14px 22px 13px;
	border: 1px solid var(--c-white);
	border-radius: var(--brad-button-medium);
	background-color: rgba(255, 255, 255, 0.05);
	min-width: 70px;
	margin: 0.5rem;
	transition: background-color 0.2s ease;
}

.devotional-banner__hero:hover .devotional-banner__button {
	background-color: rgba(255, 255, 255, 0.12);
}

.devotional-banner__watch-icon {
	width: 15px;
	height: 15px;
	margin-right: 10px;
}

/* Undertext - "TODAY'S DEVOTIONAL" or "TODAY'S FORUM" */
.devotional-banner__undertext {
	grid-column: 2/3;
	grid-row: 7/8;
	justify-self: center;
	display: flex;
	z-index: 1;
	font-family: var(--f-ibm-plex-sans);
	font-size: 26px;

	/* The original says "bolder"; inherited weight
	   is 400, so that computes to exactly this. */
	font-weight: 700;
	color: var(--c-blue-light);
	text-align: center;
	margin: 1rem 0 1.5rem;
}

/* Overlay link: covers the whole banner card so any click opens the devotional.
   Accessible card-link pattern - single link, named via aria-label. */
.devotional-banner__overlay {
	position: absolute;
	inset: 0;
	z-index: 4;
	text-decoration: none;
}

/* Sole keyboard-focusable element in the banner and it has no visible text,
   so give it a clear focus ring (inset so it shows over the image). */
.devotional-banner__overlay:focus-visible {
	outline: 3px solid var(--c-white);
	outline-offset: -3px;
}

/* ===========================================
   Responsive Styles
   =========================================== */

@media (min-width: 640px) {

	.devotional-banner__supertext {
		letter-spacing: 2.3px;
		margin-top: 24px;
	}

	.devotional-banner__meta {
		flex-direction: row;
		margin-top: 3.5rem;
	}

	.devotional-banner__meta-text {
		font-size: 25px;
		margin: 0 0 0 1rem;
	}

	.devotional-banner__portrait-image {
		width: 120px;
		height: 120px;
	}

	.devotional-banner__heading {
		max-width: 640px;
		font-size: 59px;
		letter-spacing: 0.5px;
	}

	/* Releasing the 300px base width lets the position breathe on wider screens,
	   but with nothing in its place a long position runs as one unbroken line
	   and blows out the centre grid track (see .devotional-banner__content).
	   Bound it at the same 640px the heading uses, so both wrap to one edge. */
	.devotional-banner__subheading {
		width: auto;
		max-width: 640px;
	}

	.devotional-banner__undertext {
		font-size: 47px;
		margin-top: 3rem;
	}
}

@media (min-width: 1200px) {

	/* Portrait leaves the centered stack and sits to the left of the name. */
	.devotional-banner__portrait {
		grid-column: 1/2;
		grid-row: 4/6;
		justify-self: end;
		align-self: start;
		margin: 0 10px;
	}

	.devotional-banner__heading {
		max-width: 1200px;
		margin: 1rem 0 0;
	}
}
