/**
 * Port Companion — News & Announcements
 *
 * Every color and metric is a custom property on .pc-news, so the Elementor
 * Style tab (or your theme) can retheme the block without overriding rules.
 */

.pc-news {
	/* DIN Next LT Pro is a licensed face — the theme or an Adobe Fonts kit must
	   load it. The stack below is the fallback if it is not available. */
	--pc-font: "DIN Next LT Pro", "DIN Next", "Helvetica Neue", Helvetica, Arial, sans-serif;

	--pc-ink: #0b1b4b;
	--pc-body: #5b6479;
	--pc-accent: #f5a623;
	--pc-accent-ink: #ffffff;
	--pc-badge: #00adbb;
	--pc-card-bg: #ffffff;
	--pc-border: #e4e8f0;
	--pc-divider: #00adbb;
	--pc-radius: 8px;
	--pc-gap: 16px;

	/* Type scale */
	--pc-card-title-size: 40px;
	--pc-meta-size: 14px;
	--pc-pill-size: 14px;
	--pc-button-size: 16px;

	position: relative;
	color: var(--pc-body);
	font-family: var(--pc-font);
}

/* Form controls do not inherit the family on their own. */
.pc-news input,
.pc-news button,
.pc-news select,
.pc-news textarea {
	font-family: inherit;
}

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

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

/* ---------------------------------------------------------------- Search */

.pc-search {
	position: relative;
	display: flex;
	align-items: center;
	margin-bottom: var(--pc-gap);
	background: var(--pc-card-bg);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
}

.pc-search:focus-within {
	border-color: var(--pc-badge);
	box-shadow: 0 0 0 3px rgba(0, 165, 181, 0.15);
}

.pc-search__icon {
	display: flex;
	padding: 0 8px 0 16px;
	color: var(--pc-body);
}

.pc-search__icon svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 1.8;
	stroke-linecap: round;
}

.pc-search__input {
	flex: 1 1 auto;
	min-width: 0;
	padding: 14px 16px 14px 0;
	border: 0;
	background: transparent;
	color: var(--pc-ink);
	font-size: 15px;
	line-height: 1.4;
}

.pc-search__input:focus {
	outline: none;
}

.pc-search__input::placeholder {
	color: #9aa3b5;
}

/* Kept for no-JS submits and keyboard users; hidden until focused. */
.pc-search__submit {
	position: absolute;
	right: 8px;
	padding: 8px 14px;
	border: 0;
	border-radius: 4px;
	background: var(--pc-accent);
	color: var(--pc-accent-ink);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	opacity: 0;
	pointer-events: none;
}

.pc-search__submit:focus-visible {
	opacity: 1;
	pointer-events: auto;
	outline: 2px solid var(--pc-ink);
	outline-offset: 2px;
}

.pc-news.no-js .pc-search__submit {
	position: static;
	margin-right: 6px;
	opacity: 1;
	pointer-events: auto;
}

/* --------------------------------------------------------------- Filters */

.pc-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 20px;
}

.pc-news .pc-pill {
	display: inline-flex;
	align-items: center;
	padding: 10px 20px;
	border: 1px solid var(--pc-border);
	border-radius: 999px;
	background: var(--pc-card-bg);
	color: var(--pc-ink);
	font-size: var(--pc-pill-size);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.pc-news .pc-pill:hover,
.pc-news .pc-pill:focus-visible {
	border-color: var(--pc-badge);
	color: var(--pc-badge);
	text-decoration: none;
}

.pc-news .pc-pill.is-active,
.pc-news .pc-pill.is-active:hover {
	background: var(--pc-accent);
	border-color: var(--pc-accent);
	color: var(--pc-accent-ink);
}

/* ----------------------------------------------------------------- Cards */

.pc-news__results {
	background: var(--pc-card-bg);
	border: 1px solid var(--pc-border);
	border-radius: var(--pc-radius);
	overflow: hidden;
	transition: opacity 0.2s ease;
}

.pc-card {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 22px 26px;
	border-bottom: 1px solid var(--pc-divider);
	position: relative;
}

.pc-card:last-child {
	border-bottom: 0;
}

.pc-card__body {
	flex: 1 1 auto;
	min-width: 0;
}

.pc-news .pc-card__meta {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-bottom: 15px;
}

.pc-news .pc-card__badge {
	color: var(--pc-badge);
	font-size: var(--pc-meta-size);
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1;
}

.pc-news .pc-card__date {
	color: var(--pc-body);
	font-size: var(--pc-meta-size);
	line-height: 1;
}

/* Scoped one level deeper than the theme's own h2 rules, which otherwise win. */
.pc-news .pc-card__title {
	margin: 0 0 10px;
	font-family: var(--pc-font);
	font-size: var(--pc-card-title-size);
	font-weight: 700;
	line-height: 1.15;
}

.pc-news .pc-card__title a {
	color: var(--pc-ink);
	text-decoration: none;
	transition: color 0.15s ease;
}

.pc-news .pc-card__title a:hover,
.pc-news .pc-card__title a:focus-visible {
	color: var(--pc-badge);
	text-decoration: none;
}

/* The title link is the real target; stretch it so the whole card is clickable. */
.pc-news .pc-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
}

.pc-card__excerpt {
	margin: 0;
	font-size: 14px;
	line-height: 1.55;
}

.pc-card__action {
	flex: 0 0 auto;
}

.pc-button {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border-radius: 4px;
	background: var(--pc-accent);
	color: var(--pc-accent-ink);
	font-size: var(--pc-button-size);
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1;
	white-space: nowrap;
}

.pc-card:hover .pc-button {
	filter: brightness(0.94);
}

.pc-button__arrow {
	transition: transform 0.15s ease;
}

.pc-card:hover .pc-button__arrow {
	transform: translateX(3px);
}

/* ----------------------------------------------------------- Empty state */

.pc-empty {
	padding: 56px 26px;
	text-align: center;
}

.pc-empty__title {
	margin: 0 0 6px;
	color: var(--pc-ink);
	font-size: 18px;
	font-weight: 700;
}

.pc-empty__text {
	margin: 0 0 18px;
	font-size: 14px;
}

.pc-empty__reset {
	display: inline-flex;
	padding: 12px 22px;
	border-radius: 4px;
	background: var(--pc-accent);
	color: var(--pc-accent-ink);
	font-size: var(--pc-button-size);
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
}

/* ------------------------------------------------------------ Pagination */

.pc-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px;
	margin-top: 20px;
}

.pc-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid var(--pc-border);
	border-radius: 4px;
	background: var(--pc-card-bg);
	color: var(--pc-ink);
	font-size: 12px;
	font-weight: 700;
	text-decoration: none;
	line-height: 1;
}

.pc-pagination a.page-numbers:hover,
.pc-pagination a.page-numbers:focus-visible {
	border-color: var(--pc-badge);
	color: var(--pc-badge);
}

.pc-pagination .page-numbers.current {
	background: var(--pc-accent);
	border-color: var(--pc-accent);
	color: var(--pc-accent-ink);
}

.pc-pagination .page-numbers.dots {
	border-color: transparent;
	background: transparent;
	font-weight: 400;
}

.pc-pagination .prev,
.pc-pagination .next {
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 11px;
}

/* --------------------------------------------------------------- Loading */

.pc-news__loader {
	position: absolute;
	left: 50%;
	bottom: 50%;
	display: none;
	gap: 6px;
	transform: translateX(-50%);
}

.pc-news.is-loading .pc-news__loader {
	display: flex;
}

.pc-news.is-loading .pc-news__results {
	opacity: 0.4;
	pointer-events: none;
}

.pc-news__loader span {
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: var(--pc-badge);
	animation: pc-bounce 0.9s infinite ease-in-out;
}

.pc-news__loader span:nth-child(2) {
	animation-delay: 0.15s;
}

.pc-news__loader span:nth-child(3) {
	animation-delay: 0.3s;
}

@keyframes pc-bounce {
	0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
	40% { transform: scale(1); opacity: 1; }
}

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

@media (max-width: 640px) {
	.pc-news {
		--pc-card-title-size: 24px;
	}

	.pc-card {
		flex-direction: column;
		align-items: flex-start;
		gap: 14px;
		padding: 20px;
	}

	.pc-filters {
		flex-wrap: nowrap;
		overflow-x: auto;
		padding-bottom: 4px;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}

	.pc-filters::-webkit-scrollbar {
		display: none;
	}

	.pc-news .pc-pill {
		flex: 0 0 auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.pc-news *,
	.pc-news *::before,
	.pc-news *::after {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}
