/*
Theme Name:   St. Croix Foundation (Hello Elementor Child)
Theme URI:    https://stxfoundation.org/
Description:  Child theme of Hello Elementor for the St. Croix Foundation site. Layouts are built in Elementor Pro; custom post types and fields are managed by JetEngine.
Author:       St. Croix Foundation
Template:     hello-elementor
Version:      1.0.0
Text Domain:  stxf
*/

/*
 * Most styling lives in the Elementor Site Kit (global colors / fonts) and
 * in the individual templates. This file only holds the small amount of CSS
 * that Elementor cannot express on its own.
 */

@font-face {
	font-family: 'Century Gothic';
	src: url('assets/fonts/century-gothic.ttf') format('truetype');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: 'Century Gothic';
	src: url('assets/fonts/century-gothic-bold.ttf') format('truetype');
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}


/* Old font-family names used by ported legacy CSS */
@font-face { font-family: 'CenturyGothic'; src: url('assets/fonts/century-gothic.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'CenturyGothic'; src: url('assets/fonts/century-gothic-bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'CenturyGothic-b'; src: url('assets/fonts/century-gothic-bold.ttf') format('truetype'); font-display: swap; }

:root {
	--stxf-primary: #7c0c13;
	--stxf-text: #2f2f2f;
	--stxf-body: #4a4a4a;
	--stxf-light: #f4f4f4;
}

html {
	scroll-behavior: smooth;
}

/* Inline links inside running text keep the brand underline style. */
.elementor-widget-text-editor a,
.elementor-widget-theme-post-content a {
	color: var(--stxf-primary);
	text-decoration: underline;
}

/* Header: sticky shadow once Elementor's sticky effect kicks in. */
.stxf-header.elementor-sticky--effects {
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
}

/* Header nav "pill" buttons (Donate / Hiring) */
.stxf-header .elementor-button {
	white-space: nowrap;
}

/* Newsletter forms (Gravity Forms + Mailchimp) - underline inputs like the original design */
.stxf-newsletter input[type="email"],
.stxf-newsletter input[type="text"] {
	border: 0;
	border-bottom: 2px solid var(--stxf-primary);
	border-radius: 0;
	background: transparent;
	padding: 8px 4px;
	color: var(--stxf-primary);
	width: 100%;
	max-width: 340px;
}

.stxf-newsletter input[type="submit"],
.stxf-newsletter button[type="submit"] {
	background: transparent;
	color: var(--stxf-primary);
	border: 2px solid var(--stxf-primary);
	border-radius: 12px;
	padding: 8px 16px;
	margin-top: 16px;
	cursor: pointer;
	transition: background-color .2s, color .2s;
}

.stxf-newsletter input[type="submit"]:hover,
.stxf-newsletter button[type="submit"]:hover {
	background: var(--stxf-primary);
	color: #fff;
}

/* Person cards (JetEngine listing) */
.stxf-person-card .elementor-widget-image img {
	aspect-ratio: 1 / 1;
	object-fit: cover;
	width: 100%;
}

/* Person popup: hide empty dynamic fields */
.stxf-person-modal .jet-listing-dynamic-field__content:empty {
	display: none;
}

/* Gravity Forms buttons inherit the brand color */
.gform_wrapper .gform_button,
.gform_wrapper input[type="submit"] {
	background-color: var(--stxf-primary);
	color: #fff;
	border: 0;
	border-radius: 10px;
	padding: 12px 24px;
}

/* Accordions / tabs converted from WPBakery */
.elementor-widget-n-accordion .e-n-accordion-item-title {
	font-family: 'Century Gothic', sans-serif;
}
.cpfooter { background-color: #f4f3ee; }

/* Person cards (Our People): photo with name / role labels overlaid bottom-left */
.stxf-person-card {
	position: relative;
	display: block;
	overflow: hidden;
}
.stxf-person-card img {
	transition: transform .4s ease;
}
.stxf-person-card:hover img {
	transform: scale(1.04);
}
.stxf-person-card .stxf-person-card__labels {
	position: absolute;
	left: 8px;
	right: 8px;
	bottom: 10px;
	align-items: flex-start;
	z-index: 2;
}
.stxf-person-card__name .jet-listing-dynamic-field__content {
	display: inline-block;
	background: var(--stxf-primary);
	color: #fff;
	font-family: 'Century Gothic', sans-serif;
	font-weight: 700;
	font-size: 15px;
	line-height: 1.3;
	padding: 4px 10px;
}
.stxf-person-card__role .jet-listing-dynamic-field__content {
	display: inline-block;
	background: rgba(47, 47, 47, .78);
	color: #fff;
	font-size: 12px;
	line-height: 1.3;
	padding: 3px 10px;
}

/* News cards: equal height inside the listing grid / carousel */
.jet-listing-grid__item .stxf-news-card {
	height: 100%;
}
.stxf-news-card .jet-listing-dynamic-image img {
	width: 100%;
	height: 170px;
	object-fit: cover;
}


/* Hide the email button on person pages when there is no email */
.stxf-person-email .elementor-button[href="mailto:"],
.stxf-person-email .elementor-button:not([href]) {
	display: none;
}

/* Bold words inside headings are brand crimson (e.g. "Committed to <b>Holistic Community Development</b>") */
.elementor-heading-title b,
.elementor-heading-title strong {
	color: var(--stxf-primary);
}

/* Latest Updates carousel (JetEngine listing, Swiper): white round arrows */
.jet-listing-grid__slider .jet-listing-grid__slider-icon {
	background: rgba(255, 255, 255, .9);
	color: var(--stxf-text);
	border-radius: 50%;
}
.jet-listing-grid__slider .jet-listing-grid__slider-icon svg {
	fill: var(--stxf-text);
}
.jet-listing-grid > .jet-listing-grid__slider-icon {
	background: rgba(255, 255, 255, .9);
	color: var(--stxf-text);
	fill: var(--stxf-text);
	border-radius: 50%;
}
@media (min-width: 1300px) {
	.jet-listing-grid > .jet-listing-grid__slider-icon.prev-arrow { left: -60px; }
	.jet-listing-grid > .jet-listing-grid__slider-icon.next-arrow { right: -60px; }
}

/* Person photos share one crop so the grid lines up */
.stxf-person-card .jet-listing-dynamic-image,
.stxf-person-card .jet-listing-dynamic-image img {
	display: block;
	width: 100%;
}
.stxf-person-card .jet-listing-dynamic-image img {
	aspect-ratio: 4 / 5;
	height: auto;
	object-fit: cover;
	object-position: center top;
}

/* News cards: every card in a row/carousel is the same height, "Read More" pinned to the bottom */
.jet-listing-grid__slider .swiper-wrapper { align-items: stretch; }
.jet-listing-grid__slider .swiper-slide,
.jet-listing-grid__item { height: auto; display: flex; }
.jet-listing-grid__item > .jet-engine-listing-overlay-wrap,
.jet-listing-grid__item > .elementor { width: 100%; display: flex; }
.jet-listing-grid__item .elementor > .stxf-news-card { width: 100%; height: 100%; }
.stxf-news-card > .e-con:last-child { flex-grow: 1; }
.stxf-news-card .elementor-widget-jet-listing-dynamic-link { margin-top: auto; }

/* Header: logo left, menu + search + Donate grouped on the right (as on the live site) */
@media (min-width: 1025px) {
	.stxf-header .elementor-element.stxf-nav { margin-left: auto !important; }
}
.stxf-header .e-con.stxf-header-cta {
	--width: auto;
	width: auto;
	flex: 0 0 auto;
}
/* Live has no dropdown arrows next to top-level menu items (desktop) */
@media (min-width: 1025px) {
	.stxf-header .elementor-nav-menu--main .sub-arrow { display: none; }
}

/* Fund cards (How to Give etc.): description slides in on hover, as on the live site */
@media (hover: hover) {
	.stxf-fund-card .elementor-cta__description {
		max-height: 0;
		opacity: 0;
		overflow: hidden;
		transition: max-height .35s ease, opacity .35s ease;
	}
	.stxf-fund-card:hover .elementor-cta__description {
		max-height: 80px;
		opacity: 1;
	}
}

/* ---- Ported from the old site's "Additional CSS" / theme ---- */
/* Alternate pink section background (e.g. Grants & Scholarships fund list) */
.e-con.altbg { background-color: #ffe8e8; }

/* Image carousels: equal-height photos, as on the old site */
.elementor-widget-image-carousel .swiper-slide-image {
	width: 100%;
	height: 300px;
	object-fit: cover;
	object-position: top;
}

/* Sponsor Pledge tabs: black tabs, crimson active/hover */
.page-id-7068 .e-n-tab-title {
	background-color: #000 !important;
	color: #fff !important;
	border-color: #f0f0f0 !important;
}
.page-id-7068 .e-n-tab-title[aria-selected="true"],
.page-id-7068 .e-n-tab-title:hover {
	background-color: #7c0c13 !important;
	color: #fff !important;
}
/* Pricing cards: small round bullets like the live site's lists */
.stxf-price-table .elementor-price-table__features-list i,
.stxf-price-table .elementor-price-table__features-list svg { font-size: 6px; width: 6px; height: 6px; vertical-align: middle; margin-right: 10px; }
.stxf-price-table .elementor-price-table { background: #ececec; height: 100%; }
/* Fund cards: 5px rounded corners like live */
.stxf-fund-card .elementor-cta { border-radius: 5px; overflow: hidden; }

/* Our Materials: publication cards - every cover sits in the same frame */
.stxf-pub-card {
	text-decoration: none;
	transition: transform .2s ease;
}
.stxf-pub-card .stxf-pub-card__cover {
	background: #f4f4f4;
	border-radius: 6px;
	padding: 14px;
	aspect-ratio: 3 / 4;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 14px;
	transition: box-shadow .2s ease;
}
.stxf-pub-card .stxf-pub-card__cover .elementor-widget-container,
.stxf-pub-card .stxf-pub-card__cover a { width: 100%; height: 100%; }
.stxf-pub-card .stxf-pub-card__cover img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
}
.stxf-pub-card:hover { transform: translateY(-3px); }
.stxf-pub-card:hover .stxf-pub-card__cover { box-shadow: 0 6px 18px rgba(0, 0, 0, .12); }
.stxf-pub-card:hover .stxf-pub-card__title .elementor-heading-title { color: var(--stxf-primary); }

/* Fund card captions can be long: clamp to 4 lines on hover */
.stxf-fund-card:hover .elementor-cta__description {
	max-height: 140px;
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
}

/* Text blocks: the last paragraph adds no extra space (the widget margin handles it, like WPBakery) */
.elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* Ported: white text on coloured banners */
.white-txt, .white-txt p, .white-txt li, .white-txt a:not(.elementor-button) { color: #fff; }

/* Text inside accordions / tabs reads darker, as on live */
.e-n-accordion-item .elementor-widget-text-editor,
.e-n-tabs-content .elementor-widget-text-editor { color: #2f2f2f; }

/* Lists in text blocks: spacing and bullets as on the live site */
.elementor-widget-text-editor ul,
.elementor-widget-text-editor ol { margin: 0 0 1em; padding-left: 1.6em; }
.elementor-widget-text-editor li { margin-bottom: 8px; }
.elementor-widget-text-editor li > ul,
.elementor-widget-text-editor li > ol { margin: 8px 0 0; }
.elementor-widget-text-editor ul ul { list-style: disc; }
/* Sub-headings inside accordion text: Lato bold like live */
.e-n-accordion-item .elementor-widget-text-editor :is(h3, h4, h5) {
	font-family: 'Lato', sans-serif;
	font-size: 18px;
	font-weight: 700;
	color: #2f2f2f;
	margin: 1em 0 .4em;
}

/* Info cards (e.g. Give Now: Wire Transfer / Mail), as on live */
.e-con.stxf-info-card {
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 2px 12px rgba(0, 0, 0, .12);
	padding: 22px !important;
	margin-bottom: 30px;
}

/* Give Now form: email / phone fields styled like the text inputs (live) */
.gform_wrapper form#gform_1 li input[type=email],
.gform_wrapper form#gform_1 li input[type=tel] {
	border: 1px solid #b8b8b8;
	border-radius: 12px;
	padding: 16px 20px;
	font-size: 16px;
	line-height: normal;
	height: auto;
	background: #fff;
}

/* ---- Our People: bio popup (like the live site) ---- */
.stxf-person-card__bio { display: none !important; }
.stxf-modal-open { overflow: hidden; }
.stxf-person-modal {
	width: min(760px, calc(100vw - 32px));
	max-height: calc(100vh - 80px);
	padding: 0;
	border: 0;
	border-radius: 10px;
	box-shadow: 0 20px 60px rgba(0, 0, 0, .35);
	overflow: auto;
}
.stxf-person-modal::backdrop { background: rgba(0, 0, 0, .6); }
.stxf-person-modal__body { padding: 50px 48px 40px; }
.stxf-person-modal__close {
	position: sticky;
	top: 0;
	float: right;
	margin: 10px 10px 0 0;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: #f2f2f2;
	color: var(--stxf-text);
	font-size: 26px;
	line-height: 40px;
	padding: 0;
	cursor: pointer;
}
.stxf-person-modal__close:hover,
.stxf-person-modal__close:focus-visible { background: var(--stxf-primary); color: #fff; }
.stxf-person-modal .stxf-bio__name,
.stxf-person-modal .stxf-bio__role,
.stxf-person-modal .stxf-bio__email { text-align: center; }
.stxf-person-modal .stxf-bio__name h3,
.stxf-person-modal .stxf-bio__name .jet-listing-dynamic-field__content {
	font-family: 'Century Gothic', sans-serif;
	font-weight: 700;
	font-size: 26px;
	line-height: 1.2;
	color: #2f2f2f;
	margin: 0 0 10px;
}
.stxf-person-modal .stxf-bio__role { font-weight: 600; color: var(--stxf-primary); margin-bottom: 6px; }
.stxf-person-modal .stxf-bio__email { margin-bottom: 24px; }
.stxf-person-modal .stxf-bio__email a { color: var(--stxf-text); }
.stxf-person-modal .stxf-bio__content { color: #2f2f2f; font-size: 16px; line-height: 1.7; }
.stxf-person-modal .stxf-bio__content p { margin: 0 0 1em; }
@media (max-width: 767px) {
	.stxf-person-modal__body { padding: 44px 22px 28px; }
	.stxf-person-modal .stxf-bio__name h3 { font-size: 22px; }
}
/* Person card is now the link inside .stxf-person */
.stxf-person { position: relative; }

/* Sidebar (posts / archives): Recent Posts list like live */
.stxf-recent-posts ul { list-style: none; margin: 0; padding: 0; }
.stxf-recent-posts li { padding: 10px 0; border-bottom: 1px solid #ececec; line-height: 1.45; }
.stxf-recent-posts li:last-child { border-bottom: 0; }
.stxf-recent-posts a { color: #2f2f2f; text-decoration: none; font-size: 15px; }
.stxf-recent-posts a:hover { color: var(--stxf-primary); text-decoration: underline; }
/* Popup fixes: beat the Elementor kit's global button style; centre JetEngine's flex fields */
dialog.stxf-person-modal button.stxf-person-modal__close {
	width: 40px;
	height: 40px;
	padding: 0;
	border-radius: 50%;
	background: #f2f2f2;
	color: #2f2f2f;
	font-size: 26px;
	line-height: 40px;
	box-shadow: none;
}
dialog.stxf-person-modal button.stxf-person-modal__close:hover,
dialog.stxf-person-modal button.stxf-person-modal__close:focus-visible {
	background: #7c0c13;
	color: #fff;
}
.stxf-person-modal :is(.stxf-bio__name, .stxf-bio__role, .stxf-bio__email) .jet-listing-dynamic-field { justify-content: center; }
.stxf-person-modal .stxf-bio__content .jet-listing-dynamic-field { display: block; }
.stxf-recent-posts h5 {
	font-family: 'Century Gothic', sans-serif;
	font-size: 20px;
	font-weight: 700;
	color: #2f2f2f;
	margin: 0 0 10px;
}

/* ---- Press Releases: year filter + dated list ---- */
.stxf-press__years {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}
.stxf-press a.stxf-press__year {
	display: inline-block;
	padding: 7px 14px;
	border: 1px solid #d9d9d9;
	border-radius: 20px;
	background: #fff;
	color: #2f2f2f;
	font-family: 'Century Gothic', sans-serif;
	font-size: 14px;
	line-height: 1.2;
	text-decoration: none;
	transition: background-color .15s, color .15s, border-color .15s;
}
.stxf-press a.stxf-press__year:hover { border-color: var(--stxf-primary); color: var(--stxf-primary); }
.stxf-press a.stxf-press__year.is-active { background: var(--stxf-primary); border-color: var(--stxf-primary); color: #fff; }
.stxf-press__year:focus-visible { outline: 2px solid var(--stxf-primary); outline-offset: 2px; }
.stxf-press__status { font-size: 14px; color: #707070; margin: 0 0 18px; }
.stxf-press__group-title {
	font-family: 'Century Gothic', sans-serif;
	font-size: 22px;
	font-weight: 700;
	color: var(--stxf-primary);
	margin: 0 0 6px;
}
.stxf-press__group + .stxf-press__group { margin-top: 28px; }
.stxf-press__list { list-style: none; margin: 0; padding: 0; }
.stxf-press__item {
	display: grid;
	grid-template-columns: 130px 1fr;
	gap: 20px;
	align-items: baseline;
	padding: 14px 0;
	border-bottom: 1px solid #e5e5e5;
}
.stxf-press__date {
	font-size: 14px;
	color: #707070;
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}
.stxf-press a.stxf-press__title {
	color: #2f2f2f;
	font-weight: 700;
	font-size: 16px;
	line-height: 1.45;
	text-decoration: none;
}
.stxf-press a.stxf-press__title:hover { color: var(--stxf-primary); text-decoration: underline; }
@media (max-width: 767px) {
	.stxf-press__years { flex-wrap: nowrap; overflow-x: auto; padding-bottom: 6px; }
	.stxf-press__year { flex: 0 0 auto; }
	.stxf-press__item { grid-template-columns: 1fr; gap: 4px; }
}
