/* =========================================================================
   Eastgate Sermons — front-end
   Uses theme.json tokens via CSS custom properties.
   ========================================================================= */

:root {
	--eg-navy: var(--wp--preset--color--navy, #1e3a5f);
	--eg-navy-deep: #0f2340;
	--eg-green: var(--wp--preset--color--green, #00875a);
	--eg-warm-white: var(--wp--preset--color--warm-white, #fdfcfa);
	--eg-warm-cream: var(--wp--preset--color--warm-cream, #f5f0e8);
	--eg-warm-border: var(--wp--preset--color--warm-border, #e5ddd2);
	--eg-warm-subtext: var(--wp--preset--color--warm-subtext, #7a6e64);
	/* Cool muted slate for secondary text (sits naturally under navy). */
	--eg-muted: #6b7785;
	/* On dark bands: lighter brand-green accent + light cool-slate for muted text. */
	--eg-green-light: #46bf94;
	--eg-on-dark: #c9d6e4;
	/* Cool light "panel" surface + border (replaces the warm cream on the sermon UI). */
	--eg-surface: #eef2f7;
	--eg-surface-border: #dde4ec;
	--eg-warm-text: var(--wp--preset--color--warm-text, #2c2416);
	--eg-display: var(--wp--preset--font-family--avenir-condensed, 'Avenir Next Condensed', sans-serif);
	--eg-body: var(--wp--preset--font-family--avenir, 'Avenir Next', sans-serif);
	--eg-wrap: 1200px;
	--eg-pad: clamp(1rem, 4vw, 2rem);
	--eg-radius: 0.75rem;
	/* Dark band sits clearly BELOW the menu's navy (#1e3a5f) for separation. */
	--eg-band: linear-gradient(165deg, #16304d 0%, #0b1a30 100%);
	--eg-band-divider: inset 0 3px 0 var(--eg-green);
}

/* ---- shared layout helpers ---- */
.eg-hero__inner,
.eg-archive__bar,
.eg-archive__grid,
.eg-series-grid,
.eg-series-sermons,
.eg-next,
.eg-sermon-header__inner {
	max-width: var(--eg-wrap);
	margin-inline: auto;
	padding-inline: var(--eg-pad);
	box-sizing: border-box;
}

.eg-grid {
	display: grid;
	gap: clamp(1rem, 2.4vw, 1.75rem);
}
.eg-grid--4 { grid-template-columns: repeat(4, 1fr); }
.eg-grid--3 { grid-template-columns: repeat(3, 1fr); }

@media (max-width: 1024px) {
	.eg-grid--4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 782px) {
	.eg-grid--4,
	.eg-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
	.eg-grid--4,
	.eg-grid--3 { grid-template-columns: 1fr; }
}

.eg-eyebrow {
	display: inline-block;
	font-family: var(--eg-display);
	text-transform: uppercase;
	letter-spacing: 0.12em;
	font-weight: 700;
	font-size: 0.8rem;
	color: var(--eg-green);
	text-decoration: none;
}
.eg-eyebrow--light { color: var(--eg-green-light); }

.eg-section-title {
	font-family: var(--eg-display);
	font-size: clamp(1.5rem, 3vw, 2rem);
	color: var(--eg-navy);
	margin: 0 0 1.25rem;
	letter-spacing: -0.01em;
}

/* ---- buttons ---- */
.eg-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	background: var(--eg-green);
	color: #fff;
	font-family: var(--eg-body);
	font-weight: 700;
	font-size: 0.95rem;
	letter-spacing: 0.02em;
	text-decoration: none;
	padding: 0.7rem 1.5rem;
	border-radius: 0.5rem;
	border: 0;
	cursor: pointer;
	transition: background 0.15s ease, transform 0.15s ease;
}
.eg-btn:hover { background: #006e49; color: #fff; transform: translateY(-1px); }
.eg-btn--small { padding: 0.55rem 1.1rem; font-size: 0.85rem; }
.eg-btn--play::before {
	content: "";
	width: 0;
	height: 0;
	border-style: solid;
	border-width: 6px 0 6px 10px;
	border-color: transparent transparent transparent #fff;
}

/* ---- card ---- */
.eg-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border: 1px solid var(--eg-surface-border);
	border-radius: var(--eg-radius);
	overflow: hidden;
	transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.eg-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px -16px rgba(15, 35, 64, 0.45);
	border-color: var(--eg-navy);
}
.eg-card__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 10;
	background: var(--eg-surface);
	overflow: hidden;
}
.eg-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.eg-card__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--eg-navy) 0%, var(--eg-navy-deep) 100%);
}
.eg-card__play,
.eg-hero__play,
.eg-hero-still__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	width: 52px;
	height: 52px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92);
	display: grid;
	place-items: center;
	transition: background 0.15s ease, transform 0.15s ease;
}
.eg-card__play::after,
.eg-hero__play::after,
.eg-hero-still__play::after {
	content: "";
	width: 0;
	height: 0;
	margin-left: 3px;
	border-style: solid;
	border-width: 8px 0 8px 13px;
	border-color: transparent transparent transparent var(--eg-navy);
}
.eg-card:hover .eg-card__play { background: var(--eg-green); }
.eg-card:hover .eg-card__play::after { border-left-color: #fff; }
.eg-hero-still:hover .eg-hero-still__play { background: var(--eg-green); }
.eg-hero-still:hover .eg-hero-still__play::after { border-left-color: #fff; }

.eg-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	padding: 1rem 1.1rem 1.25rem;
}
.eg-card__series {
	font-family: var(--eg-display);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-weight: 700;
	font-size: 0.72rem;
	color: var(--eg-green);
}
.eg-card__title {
	font-family: var(--eg-display);
	font-size: 1.2rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--eg-navy);
}
.eg-card__meta,
.eg-card__scripture {
	font-size: 0.82rem;
	color: var(--eg-muted);
}

/* ---- campus chip + speaker name pairs ---- */
.eg-card__campuses,
.eg-hero__campuses {
	display: flex;
	flex-wrap: wrap;
	gap: 0.3rem 0.7rem;
	align-items: center;
}
.eg-cs {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
}
.eg-cs__chip {
	font-family: var(--eg-display);
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 0.62rem;
	font-weight: 700;
	line-height: 1;
	color: var(--eg-navy);
	background: var(--eg-surface);
	border: 1px solid var(--eg-surface-border);
	padding: 0.2rem 0.42rem;
	border-radius: 0.3rem;
	white-space: nowrap;
}
.eg-cs__name {
	font-size: 0.8rem;
	font-weight: 400;
	color: var(--eg-muted);
}

/* ---- featured hero ---- */
.eg-hero {
	background: var(--eg-band);
	box-shadow: var(--eg-band-divider);
	color: #fff;
	padding-block: clamp(2.5rem, 6vw, 4.5rem);
}
.eg-hero__head {
	margin-bottom: clamp(1.25rem, 3vw, 2rem);
}
.eg-hero__title {
	font-family: var(--eg-display);
	font-size: clamp(2rem, 4.5vw, 3.25rem);
	line-height: 1.05;
	margin: 0.4rem 0 0.5rem;
	color: #fff;
	letter-spacing: -0.02em;
}
.eg-hero__title a { color: inherit; text-decoration: none; }
.eg-hero__title a:hover { color: var(--eg-green-light); }
.eg-hero__meta {
	color: var(--eg-on-dark);
	font-size: 1rem;
	margin: 0;
}

/* per-campus stills */
.eg-hero__stills {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: clamp(1rem, 3vw, 2rem);
}
.eg-hero__stills.is-single {
	grid-template-columns: minmax(0, 680px);
}
.eg-hero-still {
	display: block;
	text-decoration: none;
	color: #fff;
}
.eg-hero-still__media {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: var(--eg-radius);
	overflow: hidden;
	background: #000;
	box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
}
.eg-hero-still__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.3s ease;
}
.eg-hero-still:hover .eg-hero-still__media img {
	transform: scale(1.03);
}
.eg-hero-still__label {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.8rem;
}
.eg-hero-still__speaker {
	color: var(--eg-on-dark);
	font-weight: 600;
	font-size: 0.95rem;
}
.eg-hero-still__label .eg-cs__chip {
	color: #fff;
	background: rgba(255, 255, 255, 0.14);
	border-color: rgba(255, 255, 255, 0.22);
}
@media (max-width: 782px) {
	.eg-hero__stills { grid-template-columns: 1fr; }
}

/* ---- filter bar ---- */
.eg-archive__bar { margin-top: clamp(2rem, 5vw, 3.5rem); }
.eg-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	padding: 1rem 1.1rem;
	background: var(--eg-surface);
	border: 1px solid var(--eg-surface-border);
	border-radius: var(--eg-radius);
}
.eg-filters__select,
.eg-filters__search {
	font-family: var(--eg-body);
	font-size: 0.9rem;
	line-height: 1.3;
	height: 2.6rem;
	padding: 0 0.85rem;
	border: 1px solid var(--eg-surface-border);
	border-radius: 0.5rem;
	background-color: #fff;
	color: var(--eg-warm-text);
	box-sizing: border-box;
	-webkit-appearance: none;
	appearance: none;
}
.eg-filters__select {
	padding-right: 2.1rem;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%231e3a5f' stroke-width='1.5' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.85rem center;
	background-size: 0.7rem;
}
.eg-filters__search { flex: 1 1 220px; min-width: 0; }
.eg-filters__series-link {
	margin-left: auto;
	font-family: var(--eg-display);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
	font-size: 0.8rem;
	color: var(--eg-navy);
	text-decoration: none;
	white-space: nowrap;
}
.eg-filters__series-link:hover { color: var(--eg-green); }

/* ---- archive grid ---- */
.eg-archive__grid { margin-top: 1.75rem; padding-bottom: clamp(2.5rem, 6vw, 5rem); }
.eg-archive__empty {
	text-align: center;
	color: var(--eg-muted);
	padding: 3rem 0;
}

/* ---- pagination ---- */
.eg-pagination { margin-top: 2.5rem; }
.eg-pagination .page-numbers {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	justify-content: center;
	margin: 0;
	padding: 0;
}
.eg-pagination .page-numbers li a,
.eg-pagination .page-numbers li span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.4rem;
	height: 2.4rem;
	padding: 0 0.6rem;
	border-radius: 0.5rem;
	border: 1px solid var(--eg-surface-border);
	text-decoration: none;
	color: var(--eg-navy);
	font-weight: 600;
}
.eg-pagination .page-numbers li span.current {
	background: var(--eg-navy);
	color: #fff;
	border-color: var(--eg-navy);
}
.eg-pagination .page-numbers li a:hover { border-color: var(--eg-navy); }

/* ---- single sermon header ---- */
.eg-sermon-header {
	position: relative;
	overflow: hidden;
	background: linear-gradient(150deg, #0a1a33 0%, #0f2340 50%, #1d3e66 100%);
	box-shadow: var(--eg-band-divider);
	color: #fff;
	padding-block: clamp(2.25rem, 5vw, 3.5rem);
}
/* Match the page hero gradient (theme .eg-hero-deep): soft brand-blue glows. */
.eg-sermon-header::before {
	content: "";
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(closest-side, rgba(56, 116, 180, 0.30), transparent) 85% -15%/560px 560px no-repeat,
		radial-gradient(closest-side, rgba(40, 92, 150, 0.26), transparent) 4% 118%/640px 640px no-repeat,
		radial-gradient(closest-side, rgba(70, 191, 148, 0.08), transparent) 70% 112%/380px 380px no-repeat,
		radial-gradient(closest-side, rgba(255, 255, 255, 0.045), transparent) 55% -12%/300px 300px no-repeat;
}
.eg-sermon-header__inner {
	position: relative;
	z-index: 1;
}
.eg-sermon-header__title {
	font-family: var(--eg-display);
	font-size: clamp(2rem, 5vw, 3.25rem);
	line-height: 1.05;
	color: #fff;
	margin: 0.4rem 0 1rem;
	letter-spacing: -0.02em;
}
.eg-sermon-header__meta {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	padding: 0;
	color: var(--eg-on-dark);
	font-size: 0.95rem;
}
.eg-sermon-header__meta a { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.eg-sermon-header__meta a:hover { color: var(--eg-green-light); }
.eg-sermon-header__notes { font-weight: 700; }

/* ---- single sermon media ---- */
.eg-media {
	max-width: 920px;
	margin: clamp(1.5rem, 4vw, 2.75rem) auto 0;
	padding-inline: var(--eg-pad);
	box-sizing: border-box;
}
.eg-media__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-bottom: 1.25rem;
}
.eg-media__tab {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.15rem;
	padding: 0.6rem 1.1rem;
	background: var(--eg-surface);
	border: 1px solid var(--eg-surface-border);
	border-radius: 0.5rem;
	cursor: pointer;
	font-family: var(--eg-body);
	color: var(--eg-navy);
	line-height: 1.2;
}
.eg-media__tab.is-active {
	background: var(--eg-navy);
	border-color: var(--eg-navy);
	color: #fff;
}
.eg-media__tab-campus { font-weight: 700; font-size: 0.95rem; }
.eg-media__tab-speaker { font-size: 0.78rem; opacity: 0.8; }

.eg-media__panel.is-active { display: block; }
.eg-media__video {
	position: relative;
	aspect-ratio: 16 / 9;
	border-radius: var(--eg-radius);
	overflow: hidden;
	background: #000;
}
.eg-media__video iframe {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}
.eg-media__audio {
	margin-top: 1.25rem;
	padding: 1rem 1.1rem;
	background: var(--eg-surface);
	border: 1px solid var(--eg-surface-border);
	border-radius: var(--eg-radius);
}
.eg-media__audio-label {
	display: block;
	font-family: var(--eg-display);
	text-transform: uppercase;
	letter-spacing: 0.1em;
	font-weight: 700;
	font-size: 0.78rem;
	color: var(--eg-navy);
	margin-bottom: 0.5rem;
}
.eg-media__audio audio { width: 100%; }

.eg-media__transcript {
	margin-top: 1.25rem;
	border-top: 1px solid var(--eg-surface-border);
	padding-top: 1rem;
}
.eg-media__transcript summary {
	cursor: pointer;
	font-family: var(--eg-display);
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 700;
	font-size: 0.85rem;
	color: var(--eg-navy);
}
.eg-media__transcript-body {
	margin-top: 1rem;
	color: var(--eg-warm-text);
	line-height: 1.7;
}
.eg-media__transcript-body p { margin: 0 0 1rem; }
.eg-media__transcript-body .transcript-paragraph {
	cursor: pointer;
	transition: color 0.12s ease;
	scroll-margin-top: 5rem;
}
.eg-media__transcript-body .transcript-paragraph:hover { color: var(--eg-navy); }
.eg-media__transcript-body .transcript-paragraph.is-active {
	font-weight: 700;
	color: var(--eg-navy);
}

/* "Keep watching" */
.eg-next { margin-top: clamp(2.5rem, 6vw, 4rem); padding-bottom: clamp(2.5rem, 6vw, 5rem); }

/* ---- single series header ---- */
.eg-series-header {
	background: var(--eg-band);
	box-shadow: var(--eg-band-divider);
	color: #fff;
	padding-block: clamp(2.25rem, 5vw, 3.75rem);
}
.eg-series-header__inner {
	max-width: var(--eg-wrap);
	margin-inline: auto;
	padding-inline: var(--eg-pad);
	box-sizing: border-box;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: center;
}
.eg-series-header__art {
	aspect-ratio: 16 / 9;
	border-radius: var(--eg-radius);
	overflow: hidden;
	box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.7);
}
.eg-series-header__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eg-series-header__title {
	font-family: var(--eg-display);
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1.05;
	color: #fff;
	margin: 0.4rem 0 0.5rem;
	letter-spacing: -0.02em;
}
.eg-series-header__count { color: var(--eg-on-dark); font-weight: 700; margin: 0 0 0.75rem; }
.eg-series-header__desc { color: var(--eg-on-dark); line-height: 1.7; }
.eg-series-header__desc p { margin: 0 0 0.75rem; }
@media (max-width: 782px) {
	.eg-series-header__inner { grid-template-columns: 1fr; }
}

/* ---- series tiles ---- */
.eg-series-grid { padding-block: clamp(2rem, 5vw, 3.5rem); }
.eg-series-tile {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	text-decoration: none;
	color: inherit;
}
.eg-series-tile__art {
	position: relative;
	display: block;
	aspect-ratio: 16 / 9;
	border-radius: var(--eg-radius);
	overflow: hidden;
	border: 1px solid var(--eg-surface-border);
	background: var(--eg-surface);
	transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.eg-series-tile:hover .eg-series-tile__art {
	transform: translateY(-3px);
	box-shadow: 0 14px 30px -16px rgba(15, 35, 64, 0.45);
}
.eg-series-tile__art img { width: 100%; height: 100%; object-fit: cover; display: block; }
.eg-series-tile__title {
	font-family: var(--eg-display);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.2;
	color: var(--eg-navy);
}
.eg-series-tile__count { font-size: 0.8rem; color: var(--eg-muted); }
