/* wp-content/plugins/ceca-widgets/assets/ceca-cover.css */

/* Generated portrait covers styled after CECA's real report covers (the
   design's pink fallback, Figma 2654:2020): a white header band carrying
   the title in the accent colour, then the coloured body with a small white
   strap line and the two light pebble shapes cropped at the foot. Accent
   comes in as --ceca-cover-bg (four brand colours, set inline). Sketch
   style is the full-tile line-art publication artwork on white. */

.ceca-cover {
	position: relative;
	display: flex;
	flex-direction: column;
	aspect-ratio: 307 / 420;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid #e8e8e8;
}

/* --- white header band ---------------------------------------------------- */

.ceca-cover__head {
	display: block;
	padding: 16px 16px 14px;
	background: #ffffff;
}

.ceca-cover__title {
	display: block;
	color: var(--ceca-cover-bg, #c65a93);
	font-size: 16px;
	line-height: 22px;
	font-weight: 700;
	text-align: left; /* user, 2026-09-30 — was right */
	/* Long titles must never push the coloured body off the tile. */
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* --- coloured body -------------------------------------------------------- */

.ceca-cover__body {
	position: relative;
	display: block;
	flex: 1;
	min-height: 0;
	background: var(--ceca-cover-bg, #c65a93);
	overflow: hidden;
}

.ceca-cover__strap {
	position: relative;
	z-index: 1;
	display: block;
	padding: 14px 18px 0;
	color: #ffffff;
	font-size: 11px;
	line-height: 16px;
	font-weight: 700;
	text-align: left; /* user, 2026-09-28 — was centred */
}

.ceca-cover__date {
	display: block;
	margin-top: 2px;
	font-weight: 400;
}

/* The CECA mark's full petal cluster (all five petals, no lettering —
   user, 2026-09-30; was the blue + pink pair), light-tinted white and
   cropped by the foot as the report cover's motif. */
.ceca-cover__petals {
	position: absolute;
	left: -3%;
	bottom: -21%;
	width: 50%;
	aspect-ratio: 24.8 / 28;
	background: rgba(255, 255, 255, 0.5);
	-webkit-mask: url('cover-petals-full.svg') center / contain no-repeat;
	mask: url('cover-petals-full.svg') center / contain no-repeat;
}

/* --- sketch style ---------------------------------------------------------- */

.ceca-cover--sketch {
	background: #ffffff;
}

/* The artwork is the design's exact landscape crop (307:204). Anchored to
   the foot at its native aspect: it fills the resources media slot edge to
   edge, and on the portrait shop cover it sits at the bottom with clean
   white above — like CECA's real publication covers. */
.ceca-cover.ceca-cover--sketch img.ceca-cover__art {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: auto;
	aspect-ratio: 307 / 204;
	object-fit: cover;
}

/* --- uploaded featured image (wins over the generated cover) -------------- */

.ceca-cover--photo {
	background: #ffffff;
}

.ceca-cover--photo img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
}

/* --- fill mode -------------------------------------------------------------- */
/* News/event slots have their own shape (landscape cards, the hero mask), so
   the cover takes the slot's box instead of the fixed portrait ratio. */

.ceca-cover.ceca-cover--fill {
	width: 100%;
	height: 100%;
	aspect-ratio: auto;
}

/* --- topic drawing cover ------------------------------------------------------ */
/* Laid out like CECA's printed publication covers (user example 2026-09-28):
   optional coloured strip top and bottom with small white text, the title in
   grey top-left of the white sky, the CECA logo top-right, the drawing
   filling the rest. Sized in container units so the whole composition
   scales with the card, from 306px listing tiles to the event hero. The img
   rules carry extra specificity because card slots style every `img` in
   them (width/height 100%, object-fit, aspect-ratio). */

.ceca-cover--topic {
	container-type: inline-size;
	--ceca-strip-h: 0px;
}

.ceca-cover--topic {
	--ceca-strip-size: 7.6cqw;
}

/* Only a top strip pushes the title down; a bottom-only strip lies over
   the foot of the drawing (strip choice: user, 2026-09-30). */
.ceca-cover--topic.ceca-cover--strip-top {
	--ceca-strip-h: var(--ceca-strip-size);
}

.ceca-cover.ceca-cover--topic img.ceca-cover__art {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	max-width: none;
	aspect-ratio: auto;
	object-fit: cover;
	object-position: center bottom;
}

.ceca-cover__strip {
	position: absolute;
	z-index: 2;
	left: 0;
	right: 0;
	display: flex;
	align-items: center;
	height: var(--ceca-strip-size);
	padding: 0 5.5cqw;
	background: var(--ceca-cover-bg, #8cc078);
	color: #ffffff;
	font-size: max(8px, 2.7cqw);
	line-height: 1;
	white-space: nowrap;
	overflow: hidden;
}

.ceca-cover__strip--top {
	top: 0;
}

.ceca-cover__strip--bottom {
	bottom: 0;
}

.ceca-cover__topic-head {
	position: absolute;
	z-index: 1;
	top: calc(var(--ceca-strip-h) + 5cqw);
	left: 5.5cqw;
	right: 5.5cqw;
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 4cqw;
}

.ceca-cover__topic-title {
	flex: 1;
	max-width: 62%;
	color: #6b6b6b;
	font-size: max(10px, 4.6cqw);
	line-height: 1.2;
	font-weight: 400;
	text-transform: none; /* titles as written, not ALL CAPS (user, 2026-09-30) */
	letter-spacing: 0.01em;
	/* Long titles never run down into the drawing. */
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.ceca-cover.ceca-cover--topic img.ceca-cover__logo {
	position: static;
	flex: none;
	width: 26cqw;
	height: auto;
	max-width: none;
	aspect-ratio: auto;
	object-fit: contain;
}

/* Landscape slots crop the portrait drawing; lift the crop so a little sky
   stays under the title, and fade the head's backdrop to white so the title
   reads over any linework that does reach it. */
.ceca-cover--topic.ceca-cover--fill img.ceca-cover__art {
	object-position: center 65%;
}

.ceca-cover--topic.ceca-cover--fill .ceca-cover__topic-head {
	top: var(--ceca-strip-h);
	left: 0;
	right: 0;
	padding: 4cqw 5.5cqw 6cqw;
	background: linear-gradient(180deg, #ffffff 65%, rgba(255, 255, 255, 0));
}

/* --- news "Coloured" tile ------------------------------------------------ */
/* Plain brand colour with the article title left-aligned and vertically
   centred (user, 2026-09-29) — no white band, no pebbles. Text colour is
   the editor's pick (--ceca-cover-fg, set inline); black by default as it
   reads on all four brand colours. */

.ceca-cover.ceca-cover--news-color {
	container-type: inline-size;
	justify-content: center;
	/* % of the tile's own width (container units here would measure the
	   parent, not the tile). */
	padding: 0 7%;
	background: var(--ceca-cover-bg, #c65a93);
	border: 0;
}

.ceca-cover__news-title {
	display: -webkit-box;
	-webkit-line-clamp: 4;
	-webkit-box-orient: vertical;
	overflow: hidden;
	color: var(--ceca-cover-fg, #000);
	font-size: max(16px, 7cqw);
	line-height: 1.2;
	font-weight: 700;
	text-align: left;
}

/* --- news photo duotone --------------------------------------------------- */
/* Every uploaded news photo is greyscaled and multiplied over the post's
   brand colour (--ceca-tint, set inline by CECA_Cover::duotone) — CECA's
   tinted-imagery look (user, 2026-09-29: multiply, darker). isolation keeps
   the blend inside the wrapper. */

.ceca-duotone {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--ceca-tint, #5fafc4);
	isolation: isolate;
	/* Applies to the blended result: deepens the brand colour (user, 2026-09-29). */
	filter: saturate(2);
}

.ceca-duotone img {
	filter: grayscale(1);
	mix-blend-mode: multiply;
}
