/**
 * AHPC Communiqués — front-end styles.
 * Everything is scoped under .ahpc-comm so no theme or page-builder rule leaks in.
 */

.ahpc-comm {
	--ahpc-accent: #0b7e78;
	--ahpc-ink: #1f2f2e;
	--ahpc-muted: #7e8e8c;
	--ahpc-line: #e0ebe9;
	--ahpc-radius: 18px;
	--ahpc-tint: rgba(11, 126, 120, .1);
	--ahpc-tint-2: rgba(11, 126, 120, .04);
	--ahpc-cols: 4;
	--ahpc-gap: 20px;

	box-sizing: border-box;
	width: 100%;
	color: var(--ahpc-ink);
}

.ahpc-comm *,
.ahpc-comm *::before,
.ahpc-comm *::after {
	box-sizing: border-box;
}

.ahpc-comm-icon {
	width: 1em;
	height: 1em;
	display: inline-block;
	flex: 0 0 auto;
	vertical-align: middle;
}

/* Visually-hidden helper — defined here so the plugin never relies on the theme. */
.ahpc-comm .screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* ---------- Head ---------- */

.ahpc-comm__head {
	margin: 0 0 22px;
}

.ahpc-comm__heading {
	margin: 0 0 6px;
	color: var(--ahpc-ink);
	line-height: 1.25;
}

.ahpc-comm__sub {
	margin: 0;
	color: var(--ahpc-muted);
	font-size: .95em;
}

/* ---------- Controls ---------- */

.ahpc-comm__controls {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 14px;
	margin: 0 0 22px;
}

.ahpc-comm__search {
	position: relative;
	flex: 1 1 260px;
	max-width: 380px;
	margin: 0;
}

.ahpc-comm__search-icon {
	position: absolute;
	top: 50%;
	left: 14px;
	transform: translateY(-50%);
	font-size: 17px;
	color: var(--ahpc-muted);
	pointer-events: none;
	line-height: 0;
}

.ahpc-comm__search-input {
	width: 100%;
	margin: 0;
	padding: 11px 38px 11px 40px;
	border: 1px solid var(--ahpc-line);
	border-radius: 999px;
	background: #fff;
	color: var(--ahpc-ink);
	font: inherit;
	font-size: .95em;
	line-height: 1.4;
	box-shadow: none;
	transition: border-color .15s ease, box-shadow .15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.ahpc-comm__search-input:focus {
	outline: none;
	border-color: var(--ahpc-accent);
	box-shadow: 0 0 0 3px var(--ahpc-tint);
}

.ahpc-comm__search-input::-webkit-search-cancel-button {
	display: none;
}

.ahpc-comm__search-clear {
	position: absolute;
	top: 50%;
	right: 8px;
	transform: translateY(-50%);
	width: 26px;
	height: 26px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ahpc-muted);
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
}

.ahpc-comm__search-clear:hover {
	background: var(--ahpc-tint);
	color: var(--ahpc-accent);
}

.ahpc-comm__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.ahpc-comm__filter {
	--pill: var(--ahpc-accent);
	margin: 0;
	padding: 8px 15px;
	border: 1px solid var(--ahpc-line);
	border-radius: 999px;
	background: #fff;
	color: var(--ahpc-muted);
	font: inherit;
	font-size: .82em;
	font-weight: 600;
	line-height: 1.2;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ahpc-comm__filter:hover {
	color: var(--ahpc-ink);
	border-color: var(--pill);
}

.ahpc-comm__filter.is-active {
	background: var(--pill);
	border-color: var(--pill);
	color: #fff;
}

/* ---------- Grid ---------- */

.ahpc-comm__results {
	position: relative;
	min-height: 60px;
	transition: opacity .15s ease;
}

.ahpc-comm__results[aria-busy="true"] {
	opacity: .45;
}

.ahpc-comm__grid {
	display: grid;
	grid-template-columns: repeat(var(--ahpc-cols), minmax(0, 1fr));
	align-items: stretch;
	gap: var(--ahpc-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

/* ---------- Card ---------- */

.ahpc-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	background: #fff;
	border: 1px solid var(--ahpc-line);
	border-radius: var(--ahpc-radius);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	box-shadow: none;
	transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

a.ahpc-card:hover,
a.ahpc-card:focus-visible {
	transform: translateY(-3px);
	box-shadow: 0 14px 34px rgba(12, 59, 56, .09);
	border-color: var(--card-accent, var(--ahpc-accent));
	text-decoration: none;
	color: inherit;
}

a.ahpc-card:focus-visible {
	outline: 2px solid var(--card-accent, var(--ahpc-accent));
	outline-offset: 2px;
}

.ahpc-card.is-linkless {
	opacity: .75;
}

.ahpc-card__thumb {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	height: 120px;
	flex: 0 0 120px;
	background: linear-gradient(135deg, var(--card-tint, var(--ahpc-tint)), var(--ahpc-tint-2));
	color: var(--card-accent, var(--ahpc-accent));
	overflow: hidden;
}

.ahpc-card__icon {
	font-size: 30px;
	opacity: .62;
}

.ahpc-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	border-radius: 0;
}

.ahpc-card__pin {
	position: absolute;
	top: 10px;
	right: 10px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #fff;
	color: var(--card-accent, var(--ahpc-accent));
	font-size: 13px;
	box-shadow: 0 2px 6px rgba(12, 59, 56, .12);
}

.ahpc-card__body {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	padding: 18px;
	min-width: 0;
}

.ahpc-card__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	margin: 0 0 9px;
	font-size: 12px;
	line-height: 1.4;
	color: var(--ahpc-muted);
}

.ahpc-card__tag {
	display: inline-block;
	padding: 3px 9px;
	border-radius: 999px;
	background: var(--card-tint, var(--ahpc-tint));
	color: var(--card-accent, var(--ahpc-accent));
	font-size: 11px;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: .01em;
	white-space: nowrap;
}

.ahpc-card__date::before {
	content: "·";
	margin-right: 8px;
	color: var(--ahpc-line);
}

.ahpc-card__meta .ahpc-card__date:first-child::before {
	content: none;
	margin: 0;
}

.ahpc-card__title {
	display: -webkit-box;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 0;
	min-height: 2.7em;
	color: var(--ahpc-ink);
	font-size: 15px;
	font-weight: 600;
	line-height: 1.35;
	word-break: break-word;
	hyphens: auto;
}

.ahpc-card__note {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	margin: 7px 0 0;
	color: var(--ahpc-muted);
	font-size: 13px;
	line-height: 1.45;
}

.ahpc-card__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: auto;
	padding-top: 14px;
}

.ahpc-card__ext {
	display: inline-block;
	padding: 2px 7px;
	border: 1px solid var(--ahpc-line);
	border-radius: 5px;
	color: var(--ahpc-muted);
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .04em;
	line-height: 1.6;
}

.ahpc-card__cta {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	margin-left: auto;
	color: var(--card-accent, var(--ahpc-accent));
	font-size: 12px;
	font-weight: 600;
}

.ahpc-card__cta .ahpc-comm-icon {
	font-size: 14px;
	transition: transform .18s ease;
}

a.ahpc-card:hover .ahpc-card__cta .ahpc-comm-icon {
	transform: translateX(3px);
}

/* ---------- Pager, count, empty ---------- */

.ahpc-comm__pager {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 6px;
	margin: 28px 0 0;
}

.ahpc-comm__more {
	margin: 0;
	padding: 12px 28px;
	border: 1px solid var(--ahpc-accent);
	border-radius: 999px;
	background: #fff;
	color: var(--ahpc-accent);
	font: inherit;
	font-size: .9em;
	font-weight: 600;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}

.ahpc-comm__more:hover,
.ahpc-comm__more:focus-visible {
	background: var(--ahpc-accent);
	color: #fff;
}

.ahpc-comm__more.is-loading {
	opacity: .6;
	pointer-events: none;
}

.ahpc-comm__page {
	min-width: 38px;
	height: 38px;
	margin: 0;
	padding: 0 10px;
	border: 1px solid var(--ahpc-line);
	border-radius: 10px;
	background: #fff;
	color: var(--ahpc-ink);
	font: inherit;
	font-size: .88em;
	font-weight: 600;
	line-height: 1;
	cursor: pointer;
	transition: background .15s ease, color .15s ease, border-color .15s ease;
}

.ahpc-comm__page:hover:not(:disabled) {
	border-color: var(--ahpc-accent);
	color: var(--ahpc-accent);
}

.ahpc-comm__page.is-current {
	background: var(--ahpc-accent);
	border-color: var(--ahpc-accent);
	color: #fff;
}

.ahpc-comm__page:disabled {
	opacity: .4;
	cursor: default;
}

.ahpc-comm__gap {
	padding: 0 4px;
	color: var(--ahpc-muted);
}

.ahpc-comm__count {
	margin: 14px 0 0;
	text-align: center;
	color: var(--ahpc-muted);
	font-size: .82em;
}

.ahpc-comm__empty {
	margin: 0;
	padding: 46px 20px;
	border: 1px dashed var(--ahpc-line);
	border-radius: var(--ahpc-radius);
	text-align: center;
	color: var(--ahpc-muted);
}

/* ---------- CTA ---------- */

.ahpc-comm__cta {
	display: flex;
	justify-content: center;
	margin: 28px 0 0;
}

.ahpc-comm__btn {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 13px 28px;
	border: 1px solid var(--ahpc-accent);
	border-radius: 999px;
	background: var(--ahpc-accent);
	color: #fff;
	font-size: .92em;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	transition: background .18s ease, color .18s ease, transform .18s ease;
}

.ahpc-comm__btn:hover,
.ahpc-comm__btn:focus-visible {
	background: transparent;
	color: var(--ahpc-accent);
	text-decoration: none;
	transform: translateY(-2px);
}

.ahpc-comm__btn .ahpc-comm-icon {
	font-size: 16px;
	transition: transform .18s ease;
}

.ahpc-comm__btn:hover .ahpc-comm-icon {
	transform: translateX(3px);
}

/* ==========================================================================
   Compact list — [ahpc_communiques_list]

   Colour-neutral by design. Text is inherited from whatever container this
   sits in, and every divider/tint is drawn from currentColor, so the same
   markup works on a white, navy or teal card with no plugin change.
   ========================================================================== */

.ahpc-comm--list {
	--ahpc-list-accent: var(--ahpc-accent);
	--ahpc-list-clamp: 2;
	--ahpc-hl: #F2645A;
	--ahpc-hl-ink: #BC4E46;
	--ahpc-hl-tint: rgba(242, 100, 90, .12);
	--ahpc-row-pad: 12px;
	--ahpc-row-gap: 12px;

	color: inherit;
	font-size: inherit;
}

/* Comfortable rows: the taller, stacked-date rhythm. */
.ahpc-comm-list--comfortable {
	--ahpc-row-pad: 13px;
	--ahpc-row-gap: 13px;
}

.ahpc-comm--list .ahpc-comm__heading {
	color: inherit;
	margin: 0 0 14px;
}

.ahpc-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ahpc-list__item {
	position: relative;
	margin: 0;
	padding: 0;
	list-style: none;
}

.ahpc-list__item::after {
	content: "";
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	height: 1px;
	background: currentColor;
	opacity: .18;
	pointer-events: none;
}

.ahpc-list__item:last-child::after,
.ahpc-comm-list--nolines .ahpc-list__item::after {
	display: none;
}

.ahpc-list__link {
	display: flex;
	align-items: center;
	gap: var(--ahpc-row-gap);
	padding: var(--ahpc-row-pad) 0;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
	transition: opacity .15s ease;
}

.ahpc-list__link:hover,
.ahpc-list__link:focus {
	color: inherit;
	text-decoration: none;
}

.ahpc-list__link:focus-visible {
	outline: 2px solid var(--ahpc-list-accent);
	outline-offset: 3px;
	border-radius: 6px;
}

.ahpc-list__title {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-line-clamp: var(--ahpc-list-clamp, 2);
	line-clamp: var(--ahpc-list-clamp, 2);
	-webkit-box-orient: vertical;
	overflow: hidden;
	flex: 1 1 auto;
	min-width: 0;
	font-size: .94em;
	font-weight: 600;
	line-height: 1.35;
	word-break: break-word;
}

/* Reserve the full clamp height so one long title cannot make the card
   taller than the cards beside it. */
.ahpc-comm-list--even .ahpc-list__title {
	min-height: calc(1.35em * var(--ahpc-list-clamp, 2));
}

.ahpc-list__go {
	flex: 0 0 auto;
	margin-left: auto;
	padding-left: 6px;
	color: var(--ahpc-hl);
	font-size: 15px;
	line-height: 0;
	opacity: .9;
	transition: transform .16s ease;
}

.ahpc-comm-list--quiet .ahpc-list__go {
	color: var(--ahpc-list-accent);
}

.ahpc-list__go .ahpc-comm-icon {
	display: block;
}

.ahpc-list__link:hover .ahpc-list__go {
	transform: translateX(3px);
	opacity: 1;
}

/* --- Quiet style --- */

.ahpc-list__chev {
	flex: 0 0 auto;
	color: var(--ahpc-list-accent);
	font-size: 14px;
	line-height: 0;
}

/* --- Date style ---
   Compact draws the date as one inline pill, which keeps a row the same height as
   an ordinary link-list row. Comfortable stacks day over month in a taller chip. */

.ahpc-list__chip {
	position: relative;
	flex: 0 0 auto;
	border-radius: 8px;
	color: var(--ahpc-hl-ink);
	line-height: 1;
	text-align: center;
}

.ahpc-list__chip-bg {
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	border-radius: inherit;
	background: var(--ahpc-hl);
	opacity: .12;
}

.ahpc-list__day,
.ahpc-list__mon {
	position: relative;
	font-weight: 800;
}

.ahpc-list__mon {
	font-style: normal;
	letter-spacing: .08em;
}

/* Compact: "04 APR" on one line. */
.ahpc-comm-list--compact .ahpc-list__chip {
	display: inline-flex;
	align-items: baseline;
	justify-content: center;
	gap: 4px;
	min-width: 60px;
	padding: 4px 9px;
}

.ahpc-comm-list--compact .ahpc-list__day {
	font-size: .84em;
	letter-spacing: -.01em;
}

.ahpc-comm-list--compact .ahpc-list__mon {
	font-size: .62em;
}

/* Comfortable: day over month. */
.ahpc-comm-list--comfortable .ahpc-list__chip {
	display: block;
	width: 48px;
	padding: 7px 0 6px;
	border-radius: 10px;
}

.ahpc-comm-list--comfortable .ahpc-list__day {
	display: block;
	font-size: 1.05em;
	letter-spacing: -.02em;
}

.ahpc-comm-list--comfortable .ahpc-list__mon {
	display: block;
	margin-top: 3px;
	font-size: .62em;
}

.ahpc-comm-list--comfortable.ahpc-comm-list--date .ahpc-list__link {
	align-items: flex-start;
}

.ahpc-comm-list--comfortable.ahpc-comm-list--date .ahpc-list__title {
	padding-top: 3px;
}

.ahpc-comm-list--comfortable.ahpc-comm-list--date .ahpc-list__go {
	margin-top: 9px;
}

/* The newest item gets a solid pill, so the eye lands on it first. */
.ahpc-comm-list--date .ahpc-list__item.is-lead .ahpc-list__chip {
	color: #fff;
}

.ahpc-comm-list--date .ahpc-list__item.is-lead .ahpc-list__chip-bg {
	background: var(--ahpc-hl-ink);
	opacity: 1;
}

/* "New" flag on the date style. */
.ahpc-list__flag {
	flex: 0 0 auto;
	padding: 3px 8px;
	border-radius: 999px;
	background: var(--ahpc-hl-ink);
	color: #fff;
	font-size: .6em;
	font-weight: 800;
	letter-spacing: .07em;
	line-height: 1.5;
	text-transform: uppercase;
}

/* --- Category style --- */

.ahpc-comm-list--category .ahpc-list__link {
	align-items: flex-start;
}

.ahpc-list__ico {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	border-radius: 10px;
	color: var(--ahpc-list-accent);
	font-size: 19px;
}

.ahpc-list__ico::before {
	content: "";
	position: absolute;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	border-radius: inherit;
	background: currentColor;
	opacity: .1;
}

.ahpc-list__ico .ahpc-comm-icon {
	position: relative;
}

.ahpc-list__txt {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.ahpc-list__meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 7px;
	margin-bottom: 3px;
	font-size: .66em;
	font-weight: 700;
	letter-spacing: .05em;
	line-height: 1.4;
	text-transform: uppercase;
}

.ahpc-list__tag {
	color: var(--ahpc-list-accent);
}

.ahpc-list__date {
	opacity: .62;
}

.ahpc-list__new {
	padding: 2px 7px;
	border-radius: 999px;
	background: var(--ahpc-hl-ink);
	color: #fff;
	letter-spacing: .06em;
}

.ahpc-comm-list--compact .ahpc-list__ico {
	width: 30px;
	height: 30px;
	border-radius: 8px;
	font-size: 16px;
}

/* --- Dark or coloured cards (accent="inherit") ---
   The darkened coral used for text on white is unreadable on a dark card, so the
   vivid highlight takes over and the filled flags become outlines. */

/* Neutral chips read cleanly on any dark or saturated card; the highlight is then
   spent on the one lead badge instead of every row. */
.ahpc-comm-list--inherit .ahpc-list__chip {
	color: inherit;
}

.ahpc-comm-list--inherit .ahpc-list__chip-bg {
	background: currentColor;
	opacity: .16;
}

.ahpc-comm-list--inherit .ahpc-list__go {
	color: inherit;
	opacity: .75;
}

.ahpc-comm-list--inherit .ahpc-list__item.is-lead .ahpc-list__chip {
	color: #fff;
}

.ahpc-comm-list--inherit .ahpc-list__item.is-lead .ahpc-list__chip-bg {
	background: var(--ahpc-hl-ink);
	opacity: 1;
}

.ahpc-comm-list--inherit .ahpc-list__new,
.ahpc-comm-list--inherit .ahpc-list__flag {
	background: transparent;
	border: 1px solid currentColor;
	color: inherit;
	opacity: .85;
}

.ahpc-comm-list--category .ahpc-list__go {
	margin-top: 10px;
}

/* --- The "view all" link --- */

.ahpc-list__more {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	margin-top: 16px;
	color: var(--ahpc-list-accent);
	font-size: .85em;
	font-weight: 700;
	line-height: 1.3;
	text-decoration: none;
}

.ahpc-list__more:hover,
.ahpc-list__more:focus {
	color: var(--ahpc-list-accent);
	text-decoration: none;
}

.ahpc-list__more .ahpc-comm-icon {
	font-size: 14px;
	transition: transform .16s ease;
}

.ahpc-list__more:hover .ahpc-comm-icon {
	transform: translateX(3px);
}

@media (max-width: 400px) {
	.ahpc-list__chip {
		width: 44px;
	}

	.ahpc-list__link {
		gap: 11px;
	}
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
	.ahpc-comm__grid {
		grid-template-columns: repeat(min(var(--ahpc-cols), 3), minmax(0, 1fr));
	}
}

@media (max-width: 900px) {
	.ahpc-comm__grid {
		grid-template-columns: repeat(min(var(--ahpc-cols), 2), minmax(0, 1fr));
	}

	.ahpc-comm__controls {
		justify-content: flex-start;
	}

	.ahpc-comm__search {
		max-width: none;
	}
}

@media (max-width: 560px) {
	.ahpc-comm {
		--ahpc-gap: 14px;
	}

	.ahpc-comm__grid {
		grid-template-columns: minmax(0, 1fr);
	}

	.ahpc-card__thumb {
		height: 104px;
		flex-basis: 104px;
	}

	.ahpc-card__title {
		min-height: 0;
		-webkit-line-clamp: 4;
		line-clamp: 4;
	}

	.ahpc-comm__filters {
		width: 100%;
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.ahpc-comm__filters::-webkit-scrollbar {
		display: none;
	}

	.ahpc-comm__filter {
		white-space: nowrap;
	}

	.ahpc-comm__btn,
	.ahpc-comm__more {
		width: 100%;
		justify-content: center;
		text-align: center;
	}
}

/* Fallback for browsers without min() inside repeat(). */
@supports not (grid-template-columns: repeat(min(4, 3), 1fr)) {
	@media (max-width: 1100px) {
		.ahpc-comm__grid {
			grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
		}
	}
}

@media (prefers-reduced-motion: reduce) {
	.ahpc-comm *,
	.ahpc-comm *::before,
	.ahpc-comm *::after {
		transition: none !important;
		animation: none !important;
	}
}

/* Print */
@media print {
	.ahpc-comm__controls,
	.ahpc-comm__pager,
	.ahpc-comm__cta {
		display: none !important;
	}

	.ahpc-card {
		break-inside: avoid;
		box-shadow: none;
	}
}
