/* =========================================================================
   Post Archive Filter Grid
   All colors are CSS variables so they can be themed from Elementor's Style
   tab or overridden in your theme.
   ========================================================================= */

.paf-wrap {
	--paf-accent: #e8821e;          /* orange: borders, hover, active     */
	--paf-accent-soft: #fbe9d4;     /* soft orange tint for active tag    */
	--paf-title: #0d9fd8;           /* blue post titles                   */
	--paf-title-hover: #0b88ba;     /* darker blue on hover               */
	--paf-card-bg: #ffffff;
	--paf-card-border: var(--paf-accent);
	--paf-meta: #7a7a7a;
	--paf-text: #4a4a4a;
	--paf-badge-bg: rgba(40, 42, 48, 0.78);
	--paf-radius: 14px;
	--paf-gap: 24px;
	--paf-sidebar-width: 240px;

	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--paf-sidebar-width);
	gap: 40px;
	align-items: start;
	box-sizing: border-box;
	width: 100%;
}

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

/* ----------------------------- Cards grid ------------------------------ */
.paf-main {
	min-width: 0;
}

.paf-grid {
	display: grid;
	grid-template-columns: repeat(var(--paf-columns, 3), minmax(0, 1fr));
	gap: var(--paf-gap);
	transition: opacity 0.25s ease;
}

.paf-grid.is-loading {
	opacity: 0.4;
	pointer-events: none;
}

/* ------------------------------- Card ---------------------------------- */
.paf-card {
	display: flex;
	flex-direction: column;
	background: var(--paf-card-bg);
	border: 1.5px solid var(--paf-card-border);
	border-radius: var(--paf-radius);
	overflow: hidden;
	box-shadow: 0 6px 20px rgba(0, 0, 0, 0.06);
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.paf-card:hover {
	transform: translateY(-3px);
	box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
}

.paf-card__thumb {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 16 / 11;
	overflow: hidden;
	background: #0c2740;
	text-decoration: none;
}

.paf-card__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.paf-card__img--placeholder {
	background: linear-gradient(135deg, #0c2740, #123b5e);
}

.paf-card__badge {
	position: absolute;
	top: 14px;
	left: 50%;
	transform: translateX(-50%);
	background: var(--paf-badge-bg);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	padding: 8px 18px;
	border-radius: 999px;
	white-space: nowrap;
	max-width: calc(100% - 28px);
	overflow: hidden;
	text-overflow: ellipsis;
}

.paf-card__body {
	padding: 20px 20px 24px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1 1 auto;
}

.paf-card__meta {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--paf-meta);
	font-size: 14px;
}

.paf-card__sep {
	opacity: 0.7;
}

.paf-card__title {
	margin: 0;
	font-size: 22px;
	line-height: 1.25;
	font-weight: 800;
}

.paf-card__title a {
	color: var(--paf-title);
	text-decoration: none;
	transition: color 0.18s ease;
}

.paf-card__title a:hover,
.paf-card__title a:focus {
	color: var(--paf-title-hover);
}

.paf-card__excerpt {
	color: var(--paf-text);
	font-size: 16px;
	line-height: 1.55;
}

.paf-empty {
	grid-column: 1 / -1;
	padding: 40px 20px;
	text-align: center;
	color: var(--paf-meta);
	font-size: 16px;
}

/* --------------------------- Load more --------------------------------- */
.paf-loadmore-wrap {
	margin-top: 32px;
	text-align: center;
}

.paf-loadmore {
	appearance: none;
	cursor: pointer;
	border: 1.5px solid var(--paf-accent);
	background: transparent;
	color: var(--paf-accent);
	font-size: 15px;
	font-weight: 700;
	padding: 12px 30px;
	border-radius: 999px;
	transition: background 0.18s ease, color 0.18s ease;
}

.paf-loadmore:hover,
.paf-loadmore:focus {
	background: var(--paf-accent);
	color: #fff;
}

.paf-loadmore[disabled] {
	opacity: 0.6;
	cursor: default;
}

/* ----------------------------- Sidebar --------------------------------- */
.paf-sidebar {
	position: sticky;
	top: 24px;
}

.paf-tags {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.paf-tags li {
	margin: 0;
}

.paf-tag {
	appearance: none;
	display: inline-block;
	width: auto;
	cursor: pointer;
	border: 0;
	background: transparent;
	color: var(--paf-title);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.3;
	text-align: left;
	padding: 8px 14px;
	border-radius: 999px;
	transition: color 0.16s ease, background 0.16s ease;
}

.paf-tag:hover,
.paf-tag:focus {
	color: var(--paf-accent);
	background: var(--paf-accent-soft);
	outline: none;
}

.paf-tag:focus-visible {
	outline: 2px solid var(--paf-accent);
	outline-offset: 2px;
}

.paf-tag.is-active {
	color: #fff;
	background: var(--paf-accent);
}

.paf-tags__empty {
	color: var(--paf-meta);
	font-size: 15px;
	padding: 8px 14px;
}

/* --------------------------- Responsive -------------------------------- */
@media (max-width: 1024px) {
	.paf-wrap {
		grid-template-columns: 1fr;
	}

	.paf-sidebar {
		position: static;
		order: -1; /* show tags above the grid on smaller screens */
	}

	.paf-tags {
		flex-direction: row;
		flex-wrap: wrap;
	}
}

@media (max-width: 880px) {
	.paf-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.paf-grid {
		grid-template-columns: 1fr;
	}

	.paf-card__title {
		font-size: 20px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.paf-card,
	.paf-card__title a,
	.paf-grid,
	.paf-tag,
	.paf-loadmore {
		transition: none;
	}

	.paf-card:hover {
		transform: none;
	}
}
