/* CEEF grant library, cards and single grant additions. Colors follow the Elementor global palette. */
:root {
	--ceef-blue: var(--e-global-color-primary, #3F6E8F);
	--ceef-navy: #1D3A52;
	--ceef-orange: var(--e-global-color-accent, #F5A821);
	--ceef-ink: var(--e-global-color-text, #24323D);
	--ceef-muted: #5B6B78;
	--ceef-line: #E3E8EC;
	--ceef-cream: #FBF7EF;
	--ceef-radius: 14px;
}

.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }

/* ---------- Buttons ---------- */
.ceef-btn { display: inline-flex; align-items: center; gap: .4em; padding: .75em 1.4em; border-radius: 999px; background: var(--ceef-blue); color: #fff !important; font-weight: 600; text-decoration: none !important; border: 2px solid var(--ceef-blue); transition: background .2s, color .2s; }
.ceef-btn:hover, .ceef-btn:focus-visible { background: var(--ceef-navy); border-color: var(--ceef-navy); }
.ceef-btn--ghost { background: transparent; color: var(--ceef-blue) !important; }
.ceef-btn--ghost:hover, .ceef-btn--ghost:focus-visible { background: var(--ceef-blue); color: #fff !important; }

/* ---------- Library layout ---------- */
.ceef-library { display: grid; grid-template-columns: 260px 1fr; gap: 40px; align-items: start; scroll-margin-top: 120px; }
@media (max-width: 900px) { .ceef-library { grid-template-columns: 1fr; gap: 24px; } }

.ceef-filters { position: sticky; top: 24px; display: flex; flex-direction: column; gap: 14px; }
@media (max-width: 900px) { .ceef-filters { position: static; } }
.ceef-filters__search { display: flex; border: 1.5px solid var(--ceef-line); border-radius: 999px; background: #fff; overflow: hidden; }
.ceef-filters__search:focus-within { border-color: var(--ceef-blue); box-shadow: 0 0 0 3px rgba(63, 110, 143, .15); }
.ceef-filters__search input { flex: 1; min-width: 0; border: 0 !important; padding: .7em 1em !important; background: transparent; font-size: 15px; outline: none; box-shadow: none !important; }
.ceef-filters__search button { border: 0; background: transparent; color: var(--ceef-blue); padding: 0 14px; cursor: pointer; }
.ceef-filters__sort { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-size: 14px; color: var(--ceef-muted); }
.ceef-filters__sort select { border: 1.5px solid var(--ceef-line); border-radius: 10px; padding: .45em .7em; background: #fff; color: var(--ceef-ink); font-size: 14px; }
.ceef-filters__group { border-top: 1px solid var(--ceef-line); padding-top: 12px; }
.ceef-filters__group summary { cursor: pointer; font-weight: 700; color: var(--ceef-ink); list-style: none; display: flex; align-items: center; gap: 8px; }
.ceef-filters__group summary::-webkit-details-marker { display: none; }
.ceef-filters__group summary::after { content: "+"; margin-left: auto; font-size: 20px; line-height: 1; color: var(--ceef-blue); }
.ceef-filters__group[open] summary::after { content: "–"; }
.ceef-count { background: var(--ceef-orange); color: var(--ceef-navy); border-radius: 999px; font-size: 12px; padding: 1px 8px; }
.ceef-filters__options { display: flex; flex-direction: column; gap: 8px; padding: 12px 2px 4px; }
.ceef-filters__options label { display: flex; align-items: center; gap: 8px; font-size: 15px; color: var(--ceef-ink); cursor: pointer; }
.ceef-filters__options input { accent-color: var(--ceef-blue); width: 17px; height: 17px; }
.ceef-filters__n { margin-left: auto; color: var(--ceef-muted); font-size: 13px; }
.ceef-filters__reset { font-size: 14px; color: var(--ceef-blue); font-weight: 600; }

.ceef-results__count { margin: 0 0 16px; color: var(--ceef-muted); font-size: 15px; }

/* ---------- Cards ---------- */
.ceef-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 28px; }
.ceef-grid--latest { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .ceef-grid--latest { grid-template-columns: 1fr; } }

.ceef-card { display: flex; flex-direction: column; background: #fff; border-radius: var(--ceef-radius); overflow: hidden; box-shadow: 0 1px 2px rgba(16, 38, 56, .06), 0 8px 24px rgba(16, 38, 56, .07); transition: transform .2s, box-shadow .2s; }
.ceef-card:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(16, 38, 56, .08), 0 16px 36px rgba(16, 38, 56, .12); }
.ceef-card__media { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--ceef-cream); }
.ceef-card__img { width: 100%; height: 100% !important; object-fit: cover; display: block; transition: transform .4s; }
.ceef-card:hover .ceef-card__img { transform: scale(1.04); }
.ceef-card__ph { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; color: #fff; background: radial-gradient(circle at 30% 20%, rgba(255, 255, 255, .18), transparent 55%), linear-gradient(135deg, var(--ph-a), var(--ph-b)); text-align: center; padding: 16px; }
.ceef-card__ph-icon { width: 54px; height: 54px; opacity: .9; }
.ceef-card__ph span { font-weight: 700; font-size: 15px; letter-spacing: .02em; text-transform: uppercase; opacity: .95; }
.ceef-card__body { display: flex; flex-direction: column; gap: 10px; padding: 18px 20px 20px; flex: 1; }
.ceef-card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-size: 13px; }
.ceef-chip { background: #EAF1F6; color: var(--ceef-blue); font-weight: 700; padding: 3px 10px; border-radius: 999px; }
.ceef-card__year { color: var(--ceef-muted); }
.ceef-card__title { font-size: 19px !important; line-height: 1.3 !important; margin: 0 !important; }
.ceef-card__title a { color: var(--ceef-navy); text-decoration: none; }
.ceef-card__title a:hover { color: var(--ceef-blue); }
/* Uniform cards: excerpts are clamped to four lines. */
.ceef-card__excerpt { margin: 0; color: var(--ceef-muted); font-size: 15px; line-height: 1.55; display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.ceef-card__more { margin-top: auto; padding-top: 6px; font-weight: 700; color: var(--ceef-blue); text-decoration: none; font-size: 15px; }
.ceef-card__more:hover { color: var(--ceef-navy); }

/* ---------- Pagination / empty ---------- */
.ceef-pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin-top: 36px; }
.ceef-pagination .page-numbers { min-width: 40px; height: 40px; padding: 0 12px; display: inline-flex; align-items: center; justify-content: center; border-radius: 999px; color: var(--ceef-navy); text-decoration: none; font-weight: 600; }
.ceef-pagination .page-numbers:hover { background: #EAF1F6; }
.ceef-pagination .current { background: var(--ceef-blue); color: #fff; }
.ceef-empty { text-align: center; padding: 60px 20px; background: var(--ceef-cream); border-radius: var(--ceef-radius); }

/* ---------- Single grant ---------- */
.ceef-breadcrumbs { display: flex; flex-wrap: wrap; gap: 8px; font-size: 14px; color: var(--ceef-muted); margin-bottom: 20px; }
.ceef-breadcrumbs a { color: var(--ceef-blue); text-decoration: none; font-weight: 600; }
.ceef-breadcrumbs a:hover { text-decoration: underline; }
.ceef-grant-details { display: flex; flex-wrap: wrap; gap: 12px 32px; margin: 0 0 28px; padding: 18px 22px; background: var(--ceef-cream); border-radius: var(--ceef-radius); }
.ceef-grant-details dt { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--ceef-muted); margin: 0; }
.ceef-grant-details dd { margin: 2px 0 0; font-weight: 700; color: var(--ceef-navy); }
.ceef-grant-body { font-size: 17px; line-height: 1.7; }
.ceef-quote { margin: 36px 0; padding: 28px 32px; border-left: 5px solid var(--ceef-orange); background: #FFF8EA; border-radius: 0 var(--ceef-radius) var(--ceef-radius) 0; }
.ceef-quote blockquote { margin: 0; border: 0; padding: 0; }
.ceef-quote p { font-size: 22px; line-height: 1.45; color: var(--ceef-navy); font-style: italic; margin: 0; }
.ceef-quote figcaption { margin-top: 12px; font-weight: 700; color: var(--ceef-muted); }
.ceef-video { position: relative; aspect-ratio: 16 / 9; margin: 36px 0; border-radius: var(--ceef-radius); overflow: hidden; background: #000; }
.ceef-video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.ceef-back { margin-top: 40px; }

/* Stacked cards in the single-grant sidebar. */
.ceef-sidebar .ceef-grid--latest { grid-template-columns: 1fr; gap: 20px; }
.ceef-sidebar .ceef-card__excerpt { -webkit-line-clamp: 3; }
