/**
 * College Posts View public styles.
 *
 * The component inherits the active theme typography and consumes the
 * College Theme design tokens when they are available. Every token has a
 * neutral fallback so the plugin remains usable with other WordPress themes.
 */
.cpv {
	--cpv-primary: var(--college-primary, #00235e);
	--cpv-primary-dark: var(--college-primary-dark, #001845);
	--cpv-accent: var(--college-accent, #ffb600);
	--cpv-link-hover: var(--college-software, #007cbf);
	--cpv-text: var(--college-text, #111827);
	--cpv-muted: var(--college-muted, #566170);
	--cpv-surface: var(--college-surface, #f7f8fa);
	--cpv-border: var(--college-border, #d9e1ea);
	--cpv-shadow: var(--college-shadow-small, 0 8px 24px rgb(0 35 94 / 8%));
	--cpv-card-radius: 0.55rem;
	--cpv-control-radius: 0.35rem;
	width: 100%;
	color: var(--cpv-text);
	font-family: inherit;
}

body.college-design-radius-custom .cpv {
	--cpv-card-radius: var(--college-card-radius, 1rem);
	--cpv-control-radius: var(--college-control-radius, 0.65rem);
}

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

.cpv__items {
	margin: 0;
	padding: 0;
}

.cpv__item {
	min-width: 0;
	margin: 0;
	overflow: hidden;
	background: #fff;
	border: 1px solid var(--cpv-border);
	border-radius: var(--cpv-card-radius);
	box-shadow: var(--cpv-shadow);
}

.cpv__media {
	display: block;
	min-width: 0;
	overflow: hidden;
	background: var(--cpv-surface);
	text-decoration: none;
}

.cpv__image,
.cpv__placeholder {
	display: block;
	width: 100%;
	height: 100%;
	margin: 0;
	object-fit: cover;
}

.cpv__placeholder {
	background:
		linear-gradient(135deg, rgb(0 35 94 / 8%), rgb(0 35 94 / 2%)),
		var(--cpv-surface);
}

.cpv__content {
	min-width: 0;
	padding: 1rem 1.1rem 1.15rem;
}

.cpv .cpv__title {
	max-width: none;
	margin: 0;
	padding: 0;
	color: var(--cpv-primary);
	font-family: var(--college-font-heading, inherit);
	font-size: clamp(1.05rem, 0.98rem + 0.25vw, 1.2rem);
	font-weight: 500;
	line-height: 1.28;
	letter-spacing: -0.01em;
	overflow-wrap: anywhere;
}

.cpv .cpv__title a,
.cpv .cpv__title a:visited {
	color: var(--cpv-primary);
	text-decoration: none;
	text-decoration-thickness: 0.09em;
	text-underline-offset: 0.18em;
}

.cpv .cpv__title a:hover {
	color: var(--cpv-link-hover);
	text-decoration: underline;
}

.cpv .cpv__excerpt {
	max-width: none;
	margin: 0.6rem 0 0;
	color: var(--cpv-muted);
	font-size: 0.95rem;
	line-height: 1.62;
	overflow-wrap: anywhere;
}

.cpv__media:focus-visible,
.cpv__title a:focus-visible,
.cpv__button:focus-visible,
.cpv__page-link:focus-visible {
	outline: 3px solid var(--cpv-primary);
	outline-offset: 3px;
	box-shadow: 0 0 0 6px rgb(255 182 0 / 45%);
}

/* News: balanced three-column cards. */
.cpv--news .cpv__items {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: clamp(1.1rem, 2vw, 1.5rem);
	align-items: stretch;
}

.cpv--news .cpv__item {
	display: flex;
	flex-direction: column;
}

.cpv--news .cpv__media {
	aspect-ratio: 16 / 10;
}

.cpv--news .cpv__content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
}

.cpv--news .cpv__title {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
}

.cpv--news .cpv__excerpt {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 4;
}

/* Student events: a compact horizontal editorial card. */
.cpv--student-events .cpv__items {
	display: grid;
	gap: 1.25rem;
}

.cpv--student-events .cpv__item {
	display: grid;
	grid-template-columns: minmax(220px, 36%) minmax(0, 1fr);
	align-items: stretch;
}

/*
 * Grid children default to an intrinsic min-width. Large source images can
 * therefore overflow the first track in some themes. Explicit zero minimums
 * keep both columns inside the card.
 */
.cpv--student-events .cpv__media,
.cpv--student-events .cpv__content {
	min-width: 0;
}

.cpv--student-events .cpv__media {
	width: 100%;
	min-height: 100%;
	aspect-ratio: 16 / 10;
}

/* Override broad theme rules such as .entry-content img { height: auto; }. */
.cpv--student-events .cpv__media > .cpv__image,
.cpv--student-events .cpv__media > .cpv__placeholder {
	width: 100%;
	max-width: 100%;
	height: 100% !important;
	min-width: 0;
	object-fit: cover;
}

.cpv--student-events .cpv__content {
	display: flex;
	flex-direction: column;
	justify-content: center;
	padding: clamp(1rem, 2.4vw, 1.5rem);
}

.cpv--student-events .cpv__title {
	font-size: clamp(1.1rem, 1rem + 0.35vw, 1.35rem);
}

.cpv--student-events .cpv__excerpt {
	margin-top: 0.65rem;
}

/* Primary action follows College Theme's navy/yellow interaction. */
.cpv a.cpv__button,
.cpv a.cpv__button:visited {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	align-self: flex-start;
	width: fit-content;
	min-height: 44px;
	margin-top: 1rem;
	padding: 0.65rem 1rem;
	border: 1px solid var(--cpv-primary);
	border-radius: var(--cpv-control-radius);
	background: var(--cpv-primary);
	box-shadow: none;
	color: #fff !important;
	-webkit-text-fill-color: #fff;
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none !important;
}

.cpv a.cpv__button:hover,
.cpv a.cpv__button:focus-visible {
	border-color: var(--cpv-accent);
	background: var(--cpv-accent);
	color: var(--cpv-primary) !important;
	-webkit-text-fill-color: var(--cpv-primary);
	text-decoration: none !important;
}

/* Pagination mirrors the future theme's archive controls. */
.cpv__pagination {
	margin-top: clamp(1.75rem, 4vw, 3rem);
}

.cpv__pagination-list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.5rem;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.cpv__pagination-list > li {
	display: block;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.cpv__pagination-list > li::marker {
	content: '';
	font-size: 0;
}

.cpv__pagination-list > li::before,
.cpv__pagination-list > li::after {
	display: none !important;
	content: none !important;
}

.cpv .cpv__page-link,
.cpv .cpv__page-link:visited,
.cpv .cpv__page-gap {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.75rem;
	min-height: 2.75rem;
	padding: 0.55rem 0.8rem;
	border: 1px solid rgb(0 35 94 / 16%);
	border-radius: max(var(--cpv-control-radius), 0.65rem);
	background: #fff;
	color: var(--cpv-primary);
	font-size: 0.9rem;
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
}

.cpv .cpv__page-link:hover,
.cpv .cpv__page-link:focus-visible {
	border-color: var(--cpv-accent);
	background: var(--cpv-accent);
	color: var(--cpv-primary);
	text-decoration: none;
}

.cpv .cpv__page-link.is-current {
	border-color: var(--cpv-accent);
	background: var(--cpv-accent);
	color: var(--cpv-primary);
	font-weight: 500;
}

.cpv .cpv__page-link--arrow {
	font-size: 1.25rem;
}

.cpv .cpv__page-gap {
	color: var(--cpv-muted);
}

.cpv__message {
	max-width: none;
	padding: 1rem 1.15rem;
	border: 1px solid var(--cpv-border);
	border-left: 0.4rem solid var(--cpv-accent);
	border-radius: var(--cpv-card-radius);
	background: #fff;
	box-shadow: var(--cpv-shadow);
}

@media (hover: hover) and (pointer: fine) and (prefers-reduced-motion: no-preference) {
	.cpv__item {
		transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
	}

	.cpv__item:hover {
		transform: translateY(-3px);
		border-color: rgb(0 35 94 / 22%);
		box-shadow: var(--college-shadow, 0 18px 48px rgb(0 35 94 / 12%));
	}
}

@media (max-width: 900px) {
	.cpv--news .cpv__items {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}

	.cpv--student-events .cpv__item {
		grid-template-columns: minmax(190px, 34%) minmax(0, 1fr);
	}
}

@media (max-width: 640px) {
	.cpv--news .cpv__items {
		grid-template-columns: minmax(0, 1fr);
		gap: 1.25rem;
	}

	.cpv--student-events .cpv__item {
		grid-template-columns: minmax(0, 1fr);
	}

	.cpv--student-events .cpv__media {
		aspect-ratio: 16 / 9;
	}

	.cpv--student-events .cpv__content {
		justify-content: flex-start;
		padding: 1rem 1.1rem 1.15rem;
	}

	.cpv__pagination-list {
		justify-content: center;
	}
}

/* Theme accessibility modes. */
.a11y-high-contrast .cpv__item,
.a11y-high-contrast .cpv__message,
.a11y-high-contrast .cpv .cpv__page-link,
.a11y-high-contrast .cpv .cpv__page-gap {
	color: #fff !important;
	background: #000 !important;
	border-color: #fff !important;
	box-shadow: none !important;
}

.a11y-high-contrast .cpv a.cpv__button,
.a11y-high-contrast .cpv a.cpv__button:visited,
.a11y-high-contrast .cpv a.cpv__button:hover,
.a11y-high-contrast .cpv a.cpv__button:focus-visible,
.a11y-high-contrast .cpv .cpv__page-link.is-current {
	color: #000 !important;
	-webkit-text-fill-color: #000;
	background: #ffea00 !important;
	border-color: #ffea00 !important;
}

@media (prefers-reduced-motion: reduce) {
	.cpv *,
	.cpv *::before,
	.cpv *::after {
		scroll-behavior: auto !important;
		transition: none !important;
	}
}

@media (forced-colors: active) {
	.cpv__item,
	.cpv__message,
	.cpv .cpv__page-link,
	.cpv .cpv__page-gap,
	.cpv a.cpv__button {
		border: 1px solid CanvasText;
		box-shadow: none;
	}
}

/* Production hardening against broad content/theme selectors. */
.cpv .cpv__item,
.cpv .cpv__content,
.cpv .cpv__title,
.cpv .cpv__excerpt {
	max-width: none;
}
