/* wp-content/plugins/ceca-widgets/widgets/resource-cards/resource-cards.css */
/* Resource Cards (Figma 2654:1352 / 2457:1270): bordered white panel with
   an accent top rule — 18/28 bold title, muted access label, muted
   "Published" line pinned to the panel foot (panel 214px min) — image
   below (204px). Featured cards look the same as the rest (user,
   2026-09-30 — the teal featured panel is gone). Locked
   (unpurchased) cards render grey and recover on hover. */

.ceca-rc {
	--ceca-rc-accent: #c65a93;
	--ceca-rc-border: #e3e3e3;
	--ceca-rc-muted: #767676;
	--ceca-rc-gap: 24px;
	--ceca-rc-head-gap: 30px;
	--ceca-rc-locked: 0.55;
}

.ceca-rc .ceca-rc__heading {
	margin: 0 0 var(--ceca-rc-head-gap);
	font-size: 32px;
	line-height: 48px;
	font-weight: 700;
	color: #000;
}

.ceca-rc__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
}

.ceca-rc a.ceca-rc__viewall,
.ceca-rc a.ceca-rc__viewall:hover,
.ceca-rc a.ceca-rc__viewall:focus {
	font-size: 16px;
	line-height: 28px;
	color: #000;
	text-decoration: none;
}

.ceca-rc a.ceca-rc__viewall:hover,
.ceca-rc a.ceca-rc__viewall:focus {
	text-decoration: underline;
}

/* --- grids ---------------------------------------------------------------- */

.ceca-rc__grid {
	display: grid;
	gap: 40px var(--ceca-rc-gap);
}

.ceca-rc__grid--four {
	grid-template-columns: repeat(4, minmax(0, 1fr));
}

.ceca-rc__grid--three {
	grid-template-columns: repeat(3, minmax(0, 1fr));
}

/* --- card ----------------------------------------------------------------- */

/* Design card (Figma 2457:1270): one bordered box with the accent bar on
   top — white meta panel above, generated cover art below. */
.ceca-rc a.ceca-rc__card {
	display: block;
	border: 1px solid var(--ceca-rc-border);
	border-top: 3px solid var(--ceca-rc-accent);
	background: #fff;
	text-decoration: none;
	transition: filter 0.3s ease, opacity 0.3s ease;
}

.ceca-rc__panel {
	display: flex;
	flex-direction: column;
	min-height: 214px;
	padding: 20px;
	border: 0;
	background: #fff;
}

.ceca-rc__title {
	display: block;
	font-size: 18px;
	line-height: 24px; /* user, 2026-09-30 — was 28px */
	font-weight: 700;
	color: #000;
}

.ceca-rc__label {
	display: block;
	margin-top: 5px;
	font-size: 16px;
	line-height: 28px;
	color: var(--ceca-rc-muted);
}

.ceca-rc__date {
	display: block;
	margin-top: auto;
	padding-top: 16px;
	font-size: 13px;
	line-height: 20px;
	color: var(--ceca-rc-muted);
}

.ceca-rc__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-top: 1px solid var(--ceca-rc-border);
}

/* Inside the boxed card the cover takes the design's landscape media slot
   and drops its own border — the card supplies it. The panel above already
   carries title/label/date, so the cover's white title band would duplicate
   it: body only here (colour, strap, petals — or the sketch art). */
.ceca-rc .ceca-cover {
	aspect-ratio: 307 / 204;
	border: 0;
}

.ceca-rc .ceca-cover__head {
	display: none;
}

/* --- topic drawing card ----------------------------------------------------- */
/* Sketch + topic drawing (CECA_Cover::topic): the whole card is laid out like
   CECA's printed covers (user example 2026-09-28) — optional coloured strip
   across the top (replacing the accent bar), the meta on WHITE with the CECA
   logo top-right, the drawing below flowing on from that whitespace, strip
   at the foot. The colour only belongs to the Coloured style. */

/* The strips must not make the card taller than its neighbours (grid rows
   would stretch the coloured cards and leave white gaps under them): the
   top strip comes out of the panel's min-height and the foot strip lies
   over the bottom of the drawing. The 3px accent bar takes the strip
   colour so the two read as one band. */
.ceca-rc a.ceca-rc__card--topic {
	position: relative;
}

.ceca-rc a.ceca-rc__card.ceca-rc__card--strip-top {
	border-top-color: var(--ceca-cover-bg, #8cc078);
}

.ceca-rc .ceca-rc__card--strip-top .ceca-rc__panel {
	min-height: calc(214px - 28px);
}

.ceca-rc__strip--bottom {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
}

.ceca-rc__strip {
	display: flex;
	align-items: center;
	height: 28px;
	padding: 0 20px;
	background: var(--ceca-cover-bg, #8cc078);
	color: #fff;
	font-size: 12px;
	line-height: 1;
	font-weight: 700;
	white-space: nowrap;
	overflow: hidden;
}

.ceca-rc .ceca-rc__card--topic .ceca-rc__panel {
	position: relative;
	padding-right: 120px;
	background: #fff;
}

.ceca-rc__logo {
	position: absolute;
	top: 22px;
	right: 20px;
	width: 88px;
	height: auto;
}

.ceca-rc .ceca-rc__card--topic .ceca-rc__media {
	aspect-ratio: 307 / 204;
	border-top: 0;
}

/* The drawings are portrait with open sky on top; the landscape slot shows
   their lower two-thirds so the scene reads while the white still joins up
   with the panel above. */
.ceca-rc .ceca-rc__card--topic img.ceca-rc__art {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center 70%;
}

.ceca-rc a.ceca-rc__card--topic:hover img.ceca-rc__art {
	filter: brightness(1.04);
}

.ceca-rc a.ceca-rc__card:hover .ceca-rc__media .ceca-cover {
	filter: brightness(1.04);
}

.ceca-rc__play {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: 66px;
	height: 66px;
	border-radius: 50%;
	background: var(--ceca-rc-accent);
	color: #fff;
	box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.ceca-rc__play svg {
	width: 26px;
	height: 26px;
	margin-left: 3px;
}

/* Locked (unpurchased): greyed until hover/focus — a visual hint only;
   the download endpoint is what actually gates the file. */
.ceca-rc a.ceca-rc__card.is-locked {
	filter: grayscale(1);
	opacity: var(--ceca-rc-locked);
}

.ceca-rc a.ceca-rc__card.is-locked:hover,
.ceca-rc a.ceca-rc__card.is-locked:focus-visible {
	filter: none;
	opacity: 1;
}

.ceca-rc a.ceca-rc__card:focus-visible {
	outline: none;
	box-shadow: 0 0 0 2px var(--ceca-rc-accent);
}

/* Members-only resource seen by a non-member (user, 2026-10-30): looks like
   any other card — no greying — and a "Member Resource Only" tooltip appears
   on hover/focus. Visual only: the download endpoint refuses the file to
   non-members. */
.ceca-rc a.ceca-rc__card.is-members-only {
	position: relative;
}

.ceca-rc a.ceca-rc__card.is-members-only[aria-disabled='true'] {
	cursor: not-allowed;
}

.ceca-rc .ceca-rc__tip {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	padding: 6px 12px;
	border-radius: 4px;
	background: #1a1a1a;
	color: #fff;
	font-size: 14px;
	line-height: 20px;
	font-weight: 600;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -50%) translateY(6px);
	transition: opacity 0.15s ease, transform 0.15s ease;
}

.ceca-rc a.ceca-rc__card.is-members-only:hover .ceca-rc__tip,
.ceca-rc a.ceca-rc__card.is-members-only:focus-visible .ceca-rc__tip {
	opacity: 1;
	transform: translate(-50%, -50%);
}

/* --- browse layout -------------------------------------------------------- */

.ceca-rc--browse {
	display: grid;
	grid-template-columns: 306px minmax(0, 1fr);
	gap: 24px;
	align-items: start;
}

/* Desktop only (the layout stacks at 1024px): the filters ride along under
   the sticky header. Capped to the viewport and scrollable, otherwise an
   expanded filter list taller than the screen could never be reached. The
   2px padding/negative margin keeps the search focus ring from being
   clipped by the overflow. */
@media (min-width: 1025px) {
	.ceca-rc__sidebar {
		position: sticky;
		top: calc(var(--ceca-header-offset, 125px) + 30px);
		max-height: calc(100vh - var(--ceca-header-offset, 125px) - 60px);
		overflow-y: auto;
		overscroll-behavior: contain;
		scrollbar-width: thin;
		padding: 2px;
		margin: -2px;
	}
}

.ceca-rc__section + .ceca-rc__section,
.ceca-rc__section {
	margin-bottom: 50px;
}

.ceca-rc__section:last-child {
	margin-bottom: 0;
}

.ceca-rc .ceca-rc__search {
	width: 100%;
	height: 40px;
	margin-bottom: 20px;
	padding: 0 20px;
	/* Figma 2609:1982: white pill, 1px #E8E8E8, text 20px in. */
	border: 1px solid #e8e8e8;
	border-radius: 300px;
	background: #fff;
	font-size: 14px;
	color: #000;
}

/* Same plum focus ring as the news search (user, 2026-09-29). */
.ceca-rc .ceca-rc__search:focus {
	outline: none;
	border-color: var(--ceca-plum, #411024);
	box-shadow: 0 0 0 1px var(--ceca-plum, #411024);
}

.ceca-rc__filter {
	border-bottom: 1px solid var(--ceca-rc-border);
}

.ceca-rc .ceca-rc__filter-toggle,
.ceca-rc .ceca-rc__filter-toggle:hover,
.ceca-rc .ceca-rc__filter-toggle:focus {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 17px 0 18px;
	border: 0;
	background: none;
	box-shadow: none;
	font-size: 22px; /* matches the news sidebar (user, 2026-09-30) */
	line-height: 26px;
	font-weight: 700;
	color: #000;
	cursor: pointer;
	text-align: left;
}

.ceca-rc__chev {
	width: 14px;
	height: 7px;
	flex: none;
	transition: transform 0.25s ease;
}

.ceca-rc__filter-toggle[aria-expanded='true'] .ceca-rc__chev {
	transform: rotate(180deg);
}

.ceca-rc__filter-body {
	padding: 0 0 14px;
}

.ceca-rc__check {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 5px 0;
	font-size: 16px;
	line-height: 20px;
	color: #000;
	cursor: pointer;
}

.ceca-rc__check input {
	accent-color: var(--ceca-rc-accent);
	width: 16px;
	height: 16px;
	flex: none;
}

.ceca-rc__no-terms {
	margin: 0;
	font-size: 14px;
	color: var(--ceca-rc-muted);
}

.ceca-rc__empty {
	font-size: 16px;
	color: var(--ceca-rc-muted);
}

.ceca-rc__more-wrap {
	margin-top: 40px;
	text-align: center;
}

.ceca-rc .ceca-rc__more,
.ceca-rc .ceca-rc__more:hover,
.ceca-rc .ceca-rc__more:focus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 40px;
	padding: 5px 28px;
	border: 0;
	border-radius: 300px;
	background: #000;
	color: #fff;
	font-size: 15px;
	line-height: 20px;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.ceca-rc .ceca-rc__more:hover,
.ceca-rc .ceca-rc__more:focus {
	opacity: 0.85;
}

/* The display rule above outranks the browser's [hidden] — restate it, or
   "Load more" shows even when there's nothing more to load. */
.ceca-rc .ceca-rc__more[hidden] {
	display: none;
}

.ceca-rc__grid.is-loading {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

@media (max-width: 1024px) {
	.ceca-rc__grid--four {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ceca-rc__grid--three {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.ceca-rc--browse {
		grid-template-columns: minmax(0, 1fr);
	}
}

@media (max-width: 600px) {
	.ceca-rc__grid--four,
	.ceca-rc__grid--three {
		grid-template-columns: minmax(0, 1fr);
	}
}
